type
stringclasses
5 values
content
stringlengths
9
163k
functions
int fil_lock_acquire(PyFilLock *lock, int blocking, struct timespec *ts) { return __lock_acquire(lock, blocking, ts); }
functions
int fil_rlock_acquire(PyFilRLock *rlock, int blocking, struct timespec *ts) { return __rlock_acquire(rlock, blocking, ts); }
functions
int fil_lock_release(PyFilLock *lock) { return __lock_release(lock); }
functions
int fil_rlock_release(PyFilRLock *rlock) { return __rlock_release(rlock); }
functions
int fil_lock_type_init(PyObject *module) { PyFilCore_Import(); if (PyType_Ready(&_lock_type) < 0) { return -1; }
includes
#include <stdio.h>
includes
#include <stdlib.h>
includes
#include <string.h>
includes
#include <ctype.h>
defines
#define FILE_ATLETI "atleti.txt"
defines
#define FILE_ESERCIZI "esercizi.txt"
defines
#define MAX_NOME 25
defines
#define LUNG_CODICE 5
defines
#define non_strutturato ;;
defines
#define F_CLEAR "cls"
defines
#define F_CLEAR "clear"
functions
Atleta inputCercaAtleta(Lista l) { char c[MAX_NOME+1]; Atleta atl; printf("Codice o cognome parziale dell'atleta: "); scanf("%s", c); if ((atl=cercaAtleta(l, c))!=NULL) { stampaAtleta(atl, stdout); return atl; }
functions
void makeDotTxt(char *dst, char *src) { strcpy(dst, src); strcat(dst, ".txt"); }
main
int main() { FILE *fp, *fEs; Atleta tmpAtl=newAtleta(); Lista atleti=newAtlCollection(); tabellaEs esercizi=newEsCollection(); char uInput[100], fileTxt[10]; char codice[LUNG_CODICE+1], nome[MAX_NOME+1], cognome[MAX_NOME+1]; char categoria[MAX_NOME+1], data[11]; int scelta=-1; ...
includes
#include <stdio.h>
includes
#include <stdio.h>
includes
#include <ctype.h>
includes
#include <stdint.h>
includes
#include <string.h>
includes
#include <stdlib.h>
defines
#define crypto777_console777_h
defines
#define crypto777_console777_c
defines
#define DEFINES_ONLY
functions
int32_t getline777(char *line,int32_t max) { #ifndef _WIN32 static char prevline[1024]; struct timeval timeout; fd_set fdset; int32_t s; line[0] = 0; FD_ZERO(&fdset); FD_SET(STDIN_FILENO,&fdset); timeout.tv_sec = 0, timeout.tv_usec = 10000; if ( (s= select(1,&fdset,NULL,NULL,&timeout...
functions
int32_t settoken(char *token,char *line) { int32_t i; for (i=0; i<32&&line[i]!=0; i++) { if ( line[i] == ' ' || line[i] == '\n' || line[i] == '\t' || line[i] == '\b' || line[i] == '\r' ) break; token[i] = line[i]; }
functions
void update_alias(char *line) { char retbuf[8192],alias[1024],*value; int32_t i,err; if ( (i= settoken(&alias[1],line)) < 0 ) return; if ( line[i] == 0 ) value = &line[i]; else value = &line[i+1]; line[i] = 0; alias[0] = '#'; printf("i.%d alias.(%s) value.(%s)\n",i,alias,valu...
functions
else if ( line[i+1] != 0 ) { for (++i,j=0; i<512&&line[i]!=' '&&line[i]!=0; i++,j++) method[j] = line[i]; method[j] = 0; }
functions
void process_userinput(char *_line) { static char *line,*line2; char plugin[512],ipaddr[1024],method[512],*cmdstr,*retstr; cJSON *json; int timeout,broadcastflag = 0; printf("[%s]\n",_line); if ( line == 0 ) line = calloc(1,65536), line2 = calloc(1,65536); expand_aliases(line,line2,65536,_li...
defines
#define GET_SPOOF_CHECKER(_data) icu_spoof_checker_data* _data; \
functions
void spoof_checker_free(void* _this) { icu_spoof_checker_data* this = _this; uspoof_close(this->service); }
functions
size_t spoof_checker_memsize(const void* _) { return sizeof(icu_spoof_checker_data); }
functions
VALUE spoof_checker_alloc(VALUE self) { icu_spoof_checker_data* this; return TypedData_Make_Struct(self, icu_spoof_checker_data, &icu_spoof_checker_type, this); }
functions
VALUE spoof_checker_initialize(VALUE self) { GET_SPOOF_CHECKER(this); this->rb_instance = self; this->service = FALSE; UErrorCode status = U_ZERO_ERROR; this->service = uspoof_open(&status); if (U_FAILURE(status)) { icu_rb_raise_icu_error(status); }
functions
VALUE spoof_checker_get_restriction_level_internal(const icu_spoof_checker_data* this) { URestrictionLevel level = uspoof_getRestrictionLevel(this->service); return INT2NUM(level); }
functions
VALUE spoof_checker_get_restriction_level(VALUE self) { GET_SPOOF_CHECKER(this); return spoof_checker_get_restriction_level_internal(this); }
functions
VALUE spoof_checker_set_restriction_level(VALUE self, VALUE level) { GET_SPOOF_CHECKER(this); uspoof_setRestrictionLevel(this->service, NUM2INT(level)); return spoof_checker_get_restriction_level_internal(this); }
functions
VALUE spoof_checker_get_checks_internal(const icu_spoof_checker_data* this) { UErrorCode status = U_ZERO_ERROR; int32_t checks = uspoof_getChecks(this->service, &status); if (U_FAILURE(status)) { icu_rb_raise_icu_error(status); }
functions
VALUE spoof_checker_get_checks(VALUE self) { GET_SPOOF_CHECKER(this); return spoof_checker_get_checks_internal(this); }
functions
VALUE spoof_checker_set_checks(VALUE self, VALUE checks) { GET_SPOOF_CHECKER(this); UErrorCode status = U_ZERO_ERROR; uspoof_setChecks(this->service, NUM2INT(checks), &status); if (U_FAILURE(status)) { icu_rb_raise_icu_error(status); }
functions
VALUE spoof_checker_confusable(VALUE self, VALUE str_a, VALUE str_b) { StringValue(str_a); StringValue(str_b); GET_SPOOF_CHECKER(this); VALUE tmp_a = icu_ustring_from_rb_str(str_a); VALUE tmp_b = icu_ustring_from_rb_str(str_b); UErrorCode status = U_ZERO_ERROR; int32_t result = uspoof_areCo...
functions
VALUE spoof_checker_get_skeleton(VALUE self, VALUE str) { StringValue(str); GET_SPOOF_CHECKER(this); VALUE in = icu_ustring_from_rb_str(str); VALUE out = icu_ustring_init_with_capa_enc(icu_ustring_capa(in), ICU_RUBY_ENCODING_INDEX); int retried = FALSE; int32_t len_bytes; UErrorCode status ...
functions
VALUE spoof_checker_check(VALUE self, VALUE rb_str) { StringValue(rb_str); GET_SPOOF_CHECKER(this); UErrorCode status = U_ZERO_ERROR; int32_t result = 0; // TODO: Migrate to uspoof_check2UTF8 once it's not draft if (icu_is_rb_str_as_utf_8(rb_str)) { result = uspoof_checkUTF8(this->servi...
functions
VALUE spoof_checker_available_checks(VALUE klass) { VALUE iv = rb_iv_get(klass, k_checks_name); if (NIL_P(iv)) { iv = rb_hash_new(); rb_hash_aset(iv, ID2SYM(rb_intern("single_script_confusable")), INT2NUM(USPOOF_SINGLE_SCRIPT_CONFUSABLE)); rb_hash_aset(iv, ID2SYM(rb_intern("mixed_script_...
functions
VALUE spoof_checker_available_restriction_levels(VALUE klass) { VALUE iv = rb_iv_get(klass, k_restriction_level_name); if (NIL_P(iv)) { iv = rb_hash_new(); rb_hash_aset(iv, ID2SYM(rb_intern("ascii")), INT2NUM(USPOOF_ASCII)); rb_hash_aset(iv, ID2SYM(rb_intern("single_script_restrictive"))...
functions
void init_icu_spoof_checker(void) { rb_cICU_SpoofChecker = rb_define_class_under(rb_mICU, "SpoofChecker", rb_cObject); rb_define_singleton_method(rb_cICU_SpoofChecker, "available_checks", spoof_checker_available_checks, 0); rb_define_singleton_method(rb_cICU_SpoofChecker, "available_restriction_levels", spo...
includes
#include <stdlib.h>
includes
#include <stdio.h>
includes
#include <unistd.h>
includes
#include <string.h>
main
int main() { // Create an instance of vulkan createInstance("Vulkan"); setupDebugging(); getDevice(); openWindow(); createCommandPool(); createCommandBuffer(); prepRender(); beginCommands(); VkClearColorValue clearColor = { .uint32 = {1, 0, 0, 1}
includes
#include <stdio.h>
structs
struct Employee { unsigned int id; char name[256]; char gender; float salary; };
functions
void addEmployee(FILE *f) { struct Employee emp; printf("Adding a new employee, please type his id \n"); int id; scanf("%d", &id); if (id > 0) { while (1) { //search if id already in use struct Employee tmp; fread(&tmp, sizeof(struct Employee), 1, f); if (feof(f) != 0) { //end of file emp.id = id; ...
functions
void removeEmployee(FILE *f) { printf("Removing employee, please type his id \n"); int id; scanf("%d)", &id); while (1) { struct Employee tmp; fread(&tmp, sizeof(struct Employee), 1, f); if (feof(f) != 0) { printf("Employee not found"); return; }
functions
void calculateAvarageSalaryByGender(FILE *f) { printf("Calculating the avarage salary by gender \n"); int maleNumber = 0; int femaleNumber = 0; float sumMale = 0; float sumFemale = 0; while (1) { struct Employee tmp; fread(&tmp, sizeof(struct Employee), 1, f); if (feof(f) != 0) break; if (tmp.id == 0) ...
functions
void exportTextFile(FILE *f) { char path[256]; printf("Please type the name of the file to store the data \n"); scanf("%s)", &path); FILE *final; if ((final = fopen(path, "w")) == NULL) { printf("Error opening/creating the file"); }
functions
void compactData(FILE *f, char fileName[]) { FILE *copy; if ((copy = fopen("copy", "wb")) == NULL) { printf("Error creating the copy file"); }
main
int main(int argc, char *argv[]) { if (argc == 3) { int option = atoi(argv[2]); FILE *f; f = fopen(argv[1], "ab+"); fclose(f); switch(option) { case 1: if ((f = fopen(argv[1], "ab+")) == NULL) { printf("Error opening/creating the file"); }
includes
#include <stdint.h>
includes
#include <string.h>
functions
void Keyboard_UpdateReport(void) { uint8_t joystick_status = Joystick_GetStatus(); HID_KEYBOARD_CLEAR_REPORT(&g_keyBoard.report[0]); switch (joystick_status) { case JOY_PRESS: HID_KEYBOARD_REPORT_SET_KEY_PRESS(g_keyBoard.report, 0x53); break; case JOY_LEFT: HID_KEYBOARD_REPORT_SET_KEY_PRESS(g_keyBoard.rep...
functions
ErrorCode_t Keyboard_GetReport(USBD_HANDLE_T hHid, USB_SETUP_PACKET *pSetup, uint8_t * *pBuffer, uint16_t *plength) { /* ReportID = SetupPacket.wValue.WB.L; */ switch (pSetup->wValue.WB.H) { case HID_REPORT_INPUT: Keyboard_UpdateReport(); memcpy(*pBuffer, &g_keyBoard.report[0], K...
functions
ErrorCode_t Keyboard_SetReport(USBD_HANDLE_T hHid, USB_SETUP_PACKET *pSetup, uint8_t * *pBuffer, uint16_t length) { /* we will reuse standard EP0Buf */ if (length == 0) { return LPC_OK; }
functions
ErrorCode_t Keyboard_EpIN_Hdlr(USBD_HANDLE_T hUsb, void *data, uint32_t event) { switch (event) { case USB_EVT_IN: g_keyBoard.tx_busy = 0; break; }
functions
ErrorCode_t Keyboard_init(USBD_HANDLE_T hUsb, USB_INTERFACE_DESCRIPTOR *pIntfDesc, uint32_t *mem_base, uint32_t *mem_size) { USBD_HID_INIT_PARAM_T hid_param; USB_HID_REPORT_T reports_data[1]; ErrorCode_t ret = LPC_OK; /* Do a quick check of if the interface descriptor passed is the right on...
functions
void Keyboard_Tasks(void) { /* check if moue report timer expired */ if (ms_timerExpired(&g_keyBoard.tmo)) { /* reset timer */ ms_timerStart(&g_keyBoard.tmo); /* check device is configured before sending report. */ if ( USB_IsConfigured(g_keyBoard.hUsb)) { /* update report based on board state */ Keyboa...
includes
#include <barrelfish/barrelfish.h>
includes
#include <flounder/flounder_support.h>
includes
#include <if/mem_defs.h>
includes
#include <string.h>
includes
#include <barrelfish/barrelfish.h>
includes
#include <flounder/flounder_support.h>
includes
#include <flounder/flounder_support_lmp.h>
includes
#include <if/mem_defs.h>
includes
#include <barrelfish/barrelfish.h>
includes
#include <barrelfish/monitor_client.h>
includes
#include <flounder/flounder_support.h>
includes
#include <flounder/flounder_support_ump.h>
includes
#include <if/mem_defs.h>
includes
#include <string.h>
includes
#include <barrelfish/barrelfish.h>
includes
#include <flounder/flounder_support.h>
includes
#include <if/mem_defs.h>
functions
errval_t mem_export(void *st, idc_export_callback_fn *export_cb, mem_connect_fn *connect_cb, struct waitset *ws, idc_export_flags_t flags) { struct mem_export *e = malloc(sizeof(struct mem_export )); if (e == NULL) { return(LIB_ERR_MALLOC_FAIL); }
functions
void mem_bind_continuation_direct(void *st, errval_t err, struct mem_binding *_binding) { // This bind cont function uses the different backends in the following order: // lmp ump_ipi ump multihop struct flounder_generic_bind_attempt *b = st; switch (b->driver_num) { case 0: (b->driver_...
functions
void mem_bind_contination_multihop(void *st, errval_t err, struct mem_binding *_binding) { // This bind cont function uses the different backends in the following order: // lmp multihop ump_ipi ump struct flounder_generic_bind_attempt *b = st; switch (b->driver_num) { case 0: (b->driver...
functions
errval_t mem_bind(iref_t iref, mem_bind_continuation_fn *_continuation, void *st, struct waitset *waitset, idc_bind_flags_t flags) { // allocate state struct flounder_generic_bind_attempt *b = malloc(sizeof(struct flounder_generic_bind_attempt )); if (b == NULL) { return(LIB_ERR_MALLOC_FAIL); }
functions
void mem_allocate_call__lmp_send_handler(void *arg) { // Get the binding state from our argument pointer struct mem_binding *_binding = arg; struct mem_lmp_binding *b = arg; errval_t err; // Switch on current outgoing message fragment switch (_binding->tx_msg_fragment) { case 0: ...
functions
void mem_allocate_response__lmp_send_handler(void *arg) { // Get the binding state from our argument pointer struct mem_binding *_binding = arg; struct mem_lmp_binding *b = arg; errval_t err; // Switch on current outgoing message fragment switch (_binding->tx_msg_fragment) { case 0: ...
functions
void mem_steal_call__lmp_send_handler(void *arg) { // Get the binding state from our argument pointer struct mem_binding *_binding = arg; struct mem_lmp_binding *b = arg; errval_t err; // Switch on current outgoing message fragment switch (_binding->tx_msg_fragment) { case 0: er...
functions
void mem_steal_response__lmp_send_handler(void *arg) { // Get the binding state from our argument pointer struct mem_binding *_binding = arg; struct mem_lmp_binding *b = arg; errval_t err; // Switch on current outgoing message fragment switch (_binding->tx_msg_fragment) { case 0: ...
functions
void mem_available_call__lmp_send_handler(void *arg) { // Get the binding state from our argument pointer struct mem_binding *_binding = arg; struct mem_lmp_binding *b = arg; errval_t err; // Switch on current outgoing message fragment switch (_binding->tx_msg_fragment) { case 0: ...
functions
void mem_available_response__lmp_send_handler(void *arg) { // Get the binding state from our argument pointer struct mem_binding *_binding = arg; struct mem_lmp_binding *b = arg; errval_t err; // Switch on current outgoing message fragment switch (_binding->tx_msg_fragment) { case 0: ...
functions
void mem_free_monitor_call__lmp_send_handler(void *arg) { // Get the binding state from our argument pointer struct mem_binding *_binding = arg; struct mem_lmp_binding *b = arg; errval_t err; // Switch on current outgoing message fragment switch (_binding->tx_msg_fragment) { case 0: ...
functions
void mem_free_monitor_response__lmp_send_handler(void *arg) { // Get the binding state from our argument pointer struct mem_binding *_binding = arg; struct mem_lmp_binding *b = arg; errval_t err; // Switch on current outgoing message fragment switch (_binding->tx_msg_fragment) { case 0:...