text stringlengths 3.08k 10.5k |
|---|
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/netlink.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/netfilter.h>
#include <linux/version.h>
#include <net/sock.h>
#include <linux/ip.h>
#include <linux/udp.h>
#include <linux/tcp.h>
#include <linux/netf... |
/*
* physical_memory_manager.h: Provide functions to allocate/free or handle blocks of physical
* memory
*/
#pragma once
#define BLOCK_SIZE 4096 // Size of 1 block of memory, 4KB
#define BLOCKS_PER_BYTE 8 // Using a bitmap, each byte will hold 8 bits/blocks
// Global variables
static uint32_t... |
// Port of the Unix compiler-compiler TMG to C99.
// Based on the original PDP-11 assembly code by <NAME>.
// (c) 2020, <NAME>, 2-clause BSD License.
//
// Structure of this implementation closely follows the structure of the
// original code. Comments starting with a lowercase letter were either
// copied from the ori... |
#include "elf.h"
#include <core/debug.h>
#include <mmu/paging.h>
#include <string.h>
int is_elf(elf_header_t* elf);
void load_segment(uint8_t* data, elf_program_header_t* program_header);
elf_section_header_t* get_elf_section_header(elf_header_t* header);
elf_section_header_t* get_elf_section(elf_header_t* header, int... |
#include "../include/list.h"
static ListNode *find_place_for_new_node(ListNode*, List*, void*, int ());
int append_to(List* a_list, void* an_object, int (*cmp)(const void*, const void*))
{
ListNode *temp_node;
temp_node = calloc(1, sizeof (ListNode));
if (!temp_node) {
msg(MALLOC_ERR);
... |
#include "vfs.h"
#include "mm.h"
#include "tmpfs.h"
#include "string.h"
#include "io.h"
#include "cpio.h"
extern struct mount* rootfs;
#define OFT_SIZE 25
struct file open_file_table[25];
#define MOUNT_TABLE_SIE 10
struct mount mount_table[MOUNT_TABLE_SIE];
void init_vfs () {
for (int i = 0; i < OFT_SIZE; i++) ... |
#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include "socket_control.h"
#include "auto.h"
#if LINUX
#else
#pragma comment(lib, "ws2_32.lib") //add ws2_32.lib
#endif
int socket_send(socket_entry* entry, char* buf,int len)
{
printf("client:%s\n",buf);
return send(entry->sock_fd, buf, len , 0)... |
#include "format-shv.h"
#include "format-jef.h"
#include "emb-file.h"
#include "emb-logging.h"
#include "helpers-binary.h"
#include <string.h>
static char shvDecode(unsigned char inputByte)
{
if(inputByte >= 0x80)
{
return (char)-((unsigned char)((~inputByte) + 1));
}
return ((char)inputByte);
... |
#include <ngram_model.h>
#include <logmath.h>
#include <strfuncs.h>
#include "test_macros.h"
#include <stdio.h>
#include <string.h>
#include <math.h>
void
run_tests(logmath_t *lmath, ngram_model_t *model)
{
int32 rv, i;
TEST_ASSERT(model);
TEST_EQUAL(ngram_wid(model, "scylla"), 285);
TEST_EQUAL(strcmp(ngram_wo... |
/*****************************************************************************
* live555_dtsgen.h : DTS rebuilder for pts only streams
*****************************************************************************
* Copyright (C) 2018 VideoLabs, VLC authors and VideoLAN
*
* This program is free software; you can re... |
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2012 Samsung Electronics
*
* 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; version 2 of the License.
*
* This program i... |
/****************************************************************************
**
** Copyright (C) 2021 MikroElektronika d.o.o.
** Contact: https://www.mikroe.com/contact
**
** This file is part of the mikroSDK package
**
** Commercial License Usage
**
** Licensees holding valid commercial NECTO compilers AI licenses ma... |
/*
* l2control.c
*
* Copyright (c) 2001-2002 <NAME> <<EMAIL>>
* 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
* n... |
//
// CSideloadKit2.c
// CSideloadKit
//
// Created by <NAME> on 11/7/21.
//
// Derived from https://gist.github.com/jhftss/729aea25511439dc34f0fdfa158be9b6
//
#include "CSideloadKit.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/fcntl.h>
#in... |
// SPDX-License-Identifier: GPL-2.0
/*
* BME680 - SPI Driver
*
* Copyright (C) 2018 <NAME> <<EMAIL>>
*/
#include <linux/acpi.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/spi/spi.h>
#include "bme680.h"
struct bme680_spi_bus_context {
struct spi_device *spi;
u8 curr... |
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <stdbool.h>
#include "ft8/text.h"
#include "ft8/pack.h"
#include "ft8/encode.h"
#include "ft8/constants.h"
#include "fft/kiss_fftr.h"
#include "common/common.h"
#include "common/debug.h"
#define LOG_LEVEL LOG_INFO
void convert_8bi... |
/*-
* BSD LICENSE
*
* Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
* Copyright(c) 2014 <NAME>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* ... |
/**
* Original base algorithm from GreenMarl.
* Otimized and edited by
* edited by <NAME>.
*/
#include "graph.h"
#include "mainFunctions.h"
#include "powerperformacetracking.h"
#include "print.h"
#include "communities.h"
#include "conduct.h"
#include "pageRank.h"
#include "sssp.h"
#include "triangleCounting.h"
#in... |
// Code to parse list of recommended track sets from file and print as browser dialog
// for client dialog (js)
//
/* Copyright (C) 2020 The Regents of the University of California
* See README in this or parent directory for licensing information. */
#include "common.h"
#include "dystring.h"
#include "hCommon.... |
/*
* external.c
*
* by <NAME> <<EMAIL>>, 2001.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but ... |
/* $NetBSD: mfbreg.h,v 1.8 1999/04/24 08:01:05 simonb Exp $ */
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* <NAME> and <NAME>.
*
* Redistribution and use in source and binary forms, with or... |
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2020 Intel Corporation <www.intel.com>
*
*/
#include <asm/arch/mailbox_s10.h>
#include <asm/arch/secure_vab.h>
#include <asm/arch/smc_api.h>
#include <asm/unaligned.h>
#include <common.h>
#include <exports.h>
#include <linux/errno.h>
#include <linux/intel-smc.h... |
#include <mongoc/mongoc.h>
#include "json-test.h"
#include "json-test-operations.h"
#include "test-libmongoc.h"
static bool
crud_test_operation_cb (json_test_ctx_t *ctx,
const bson_t *test,
const bson_t *operation)
{
bson_t reply;
bool res;
res =
json_te... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <err.h>
extern char *__progname;
void
usage() {
fprintf(stderr, "usage: %s [-hrnls] [-b base] [infile [outfile]]\n", __progname);
exit(1);
}
int
main(int argc, char *argv[]) {
int ropt;
ropt = 0;
int nopt;
nopt = 0;
int lo... |
#include "strings_and_files.h"
int is_countable(const unsigned char c) {
return isalnum(c);
}
void swap_ptrs(void **first, void **second) {
assert(first);
assert(second);
void *tmp = *second;
*second = *first;
*first = tmp;
}
void qqh_sort(void *input_arr, const size_t elem_cnt, const size_t... |
/*
* Simple command-line kernel monitor useful for controlling the kernel and
* exploring the system interactively.
*/
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <x86-64/asm.h>
#include <kernel/console.h>
#include <kernel/monitor.h>
#include <kernel/mem.h>
#define CMDBUF_SIZE 80 /* enou... |
/*
* jitregs.c
*
* This file is part of the Oxford Oberon-2 compiler
* Copyright (c) 2006 <NAME>
* 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 mus... |
#include "oop.h"
#pragma bank 1
#include "elements.h"
#include "elements_utils.h"
#include "game.h"
#include "math.h"
#include "sound_consts.h"
#include "timer.h"
void ElementMove(uint8_t old_x, uint8_t old_y, uint8_t new_x, uint8_t new_y) {
uint8_t stat_id = get_stat_id_at(old_x, old_y);
if (stat_id != STAT_ID_NON... |
#pragma once
//#include "devcb.h"
#define DEVCB_TYPE_NULL (0)
#define DEVCB_NULL { DEVCB_TYPE_NULL }
/*
AY-3-8910A: 2 I/O ports
AY-3-8912A: 1 I/O port
AY-3-8913A: 0 I/O port
AY8930: upper compatible with 8910.
In extended mode, it has higher resolution and duty ratio setting
YM2149: higher resolution
YM3439:... |
/*
* __ __ __ __ __ __
* /\ "-.\ \ /\ \/\ \ /\ \ /\ \
* \ \ \-. \ \ \ \_\ \ \ \ \____ \ \ \____
* \ \_\\"\_\ \ \_____\ \ \_____\ \ \_____\
* \/_/ \/_/ \/_____/ \/_____/ \/_____/
* ______ ______ __ ______ ______ ______
* /\ __ \ /\ ==... |
/*
* Copyright 2019, Cypress Semiconductor Corporation or a subsidiary of
* Cypress Semiconductor Corporation. All Rights Reserved.
*
* This software, associated documentation and materials ("Software")
* is owned by Cypress Semiconductor Corporation,
* or one of its subsidiaries ("Cypress") and is protected by ... |
#include <vfs.h>
#include <string.h>
#include <syscall.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <mstr.h>
#include <ipc.h>
int vfs_new_node(fsinfo_t* info) {
return syscall1(SYS_VFS_NEW_NODE, (int32_t)info);
}
const char* vfs_fullname(const char* fname) {
str_t* fullname = str_new("");
... |
/**
* PS Move API - An interface for the PS Move Motion Controller
* Copyright (c) 2012 <NAME> <<EMAIL>>
* 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... |
/***************************************************
* FILENAME : ball.c
*
* DESCRIPTION :
* Manages ball update and spawning.
*
* NOTES :
*
* AUTHOR : Daniel "Dnawrkshp" Gerendasy
*/
#include <tamtypes.h>
#include <string.h>
#include <libdl/time.h>
#include <libdl/game.h>
#include <libdl/gamesetti... |
/*
** Zabbix
** Copyright (C) 2001-2015 Zabbix SIA
**
** 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 2 of the License, or
** (at your option) any later version.
**
** This pro... |
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include<locale.h> // Para colocar acentuação
double Polinomio (double x);
double romberg(double f(double), double a, double b, int n, double **R);
double Polinomio (double x)// Função usada para cálculo do polinômio
{
return pow(x,2); // Aqui o u... |
/* CartV4.c by <NAME> 9 / 18 / 21 */
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <ctype.h>
//TODO: getItemQuan() needs error proofing for char input from userclear
int getItemQuan(int max, char *item)
{
int numItems = 0;
do
{
printf("\n\nNumber of %s (0-%d) ", item, max); // ... |
/*
Copyright (C) 1990-1996 <NAME>, <NAME>, <NAME>,
<NAME>, <NAME> and <NAME>.
Permission is granted to any individual or institution to use, copy, or
redistribute this software so long as all of the original files are included,
that it is not sold for profit, and that this copyright notice is retained.
*/
/*
*... |
// Copyright(c) 2018-2019, Intel Corporation
//
// 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... |
/**
******************************************************************************
* @file EXTI/EXTI_Example/main.c
* @author MCD Application Team
* @version V1.1.3
* @date 14-December-2021
* @brief Main program body
************************************************************************... |
/*
lcd.c - Routines for sending data and commands to the LCD shield
*/
#include <avr/io.h>
#include <util/delay.h>
#include "lcd.h" // Declarations of the LCD functions
/* This function not declared in lcd.h since
should only be used by the routines in this file. */
void lcd_writenibble(unsigned ... |
/*-----------------------------
[strings.c]
- <NAME> 2020
-----------------------------*/
#include <math.h>
#include <setjmp.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <cmocka.h>
#include "japan-string.h"
... |
/*********************************************************************************/
/* Assignment 1: 2-D/ NxN Matrix Swap and Multiplication ************************/
/* Name: <NAME> **************************************************/
/*********************************************************************************/
... |
/*
* Copyright (c) 2019-2020 by <NAME> (<EMAIL>)
*
* 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, m... |
#include "physical.h"
// Defenitions.
#define READP 0x378
#define KEYBOARD 0x60 // The keyboard I/O port.
#define KCONTROL 0x64 // The keyboard/mouse control port.
#define ESCAPE 0x81 // ESC key code (on the KEYBOARD port).
#define KEVENT 0x14 // Keyboard event core (on the KCONTROL port).
#define PHYS_ZERO 0x00... |
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <ext2fs/ext2fs.h>
#include <sys/stat.h>
#include "../include/rmdir.h"
#include "../include/util.h"
#include "../include/terminal.h"
#include "../include/type.h"
extern char pathname[128];
extern int dev;
extern PROC *running;
int my_rmdir() {
if... |
/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
Portions Copyright 2011 <NAME>. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Found... |
/*
* Acess2 Kernel
* - By <NAME> (thePowersGang)
*
* semaphore.c
* - Semaphores
*/
#define DEBUG 0
#include <acess.h>
#include <semaphore.h>
#include <threads_int.h>
#define SEMAPHORE_DEBUG 0 // Debug semaphores
// === CODE ===
//
// Initialise a semaphore
//
void Semaphore_Init(tSemaphore *Sem, int Value, int... |
/* ------------------------------------------------------------------------ */
/* Copyright 2018, IBM Corp. */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* y... |
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2020 <NAME> for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to ... |
/***************************************************************************
*
* Copyright (C) 2007 - 2012, Rogvall Invest AB, <<EMAIL>>
*
* This software is licensed as described in the file COPYRIGHT, which
* you should have received as part of this distribution. The terms
* are also available at http://www.rog... |
#include <xcb/xcb.h>
#include <xcb/xcb_aux.h>
#include <stdlib.h>
#include <stdio.h>
#include <err.h>
#include <unistd.h>
#include "com.h"
#include "xcb.h"
#define MAX(A, B) ((A) > (B) ? (A) : (B))
#define MIN(A, B) ((A) < (B) ? (A) : (B))
static xcb_connection_t *conn;
static unsigned i... |
/*
st_lib - Library containing various utility functions, coded in C.
Warning: This code is *intentionally* not compatible with C++
Copyright 2012 by <NAME> srl
*/
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <signal.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <s... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#define DNS_A 0x01
#define DNS_CNAME 0x05
//#define DNS_AAAA 0x28
/* DNS header */
typedef struct {
u_short id;
u_sho... |
/**
* @file test_pkt-util.c
* @brief Tests for packet util functions
*
* Copyright (C) 2018 Safety IO
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all ... |
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-03-11 wangyq the first version
* 2019-11-01 wangyq update libraries
*/
#include <rthw.h>
#include <rtthread.h>
#include ... |
#pragma once
#define GC_DEBUG 1
#include <stdint.h>
#include <stdbool.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <setjmp.h>
#include <math.h>
#include <unistd.h>
#include <sys/errno.h>
#include <gc/gc.h>
#include <gmp.h>
///////////////////////////////... |
// SPDX-License-Identifier: GPL-2.0
/*
* Functions corresponding to SET password methods under BIOS attributes interface GUID
*
* Copyright (c) 2020 Dell Inc.
*/
#include <linux/wmi.h>
#include "dell-wmi-sysman.h"
static int call_password_interface(struct wmi_device *wdev, char *in_args, size_t size)
{
struct a... |
#include "pwr.h"
#include "led.h"
#include <stm32f1xx_ll_adc.h>
#include <stm32f1xx_ll_gpio.h>
#define BAT_PIN LL_GPIO_PIN_0
#define USB_PIN LL_GPIO_PIN_8
#define LATCH_PIN LL_GPIO_PIN_13
#define CHG_EN_PIN LL_GPIO_PIN_9
#define CHG_500MA_PIN LL_GPIO_PIN_14
#define CHG_1000MA_PIN LL_GPIO_PIN_15
#define BAT_MAX 2960... |
/*
============================================================================
Authors:
<NAME> and <NAME>*
*Department of Informatics
Universidad Nacional de San Antonio Abad del Cusco (UNSAAC) - Perú
============================================================================
*/
#include "spider.h"
voi... |
/*
* (C) Copyright 2008 Semihalf
*
* (C) Copyright 2000-2004
* DENX Software Engineering
* <NAME>, <EMAIL>
*
* Updated-by: <NAME> <<EMAIL>>
* FIT image specific code abstracted from mkimage.c
* some functions added to address abstraction
*
* All rights reserved.
*
* This program is free software; you can... |
/**
* \file timer_hw.c
*
* \brief Handler timer functionalities
*
* Copyright (c) 2016 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions ... |
#include "fsio.h"
#include "stringfn.h"
#include "test.h"
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
char *global_session_id = NULL;
int global_counter = 1;
enum HSServeFlowResponse _test_serve(struct HSRoute *route,... |
#include "ble_kpanel.h"
#include <stdbool.h>
#include <stdlib.h>
#include <stdint.h>
#include "bsp.h"
#include "sdk_common.h"
#include "ble_srv_common.h"
#include "nrf_gpio.h"
#include "nrf.h"
#include "boards.h"
#include "nrf_log.h"
#include "kpanel_panel.h"
/**@brief Function for handling the Connect event.
*
*... |
// Copyright (C) 2017 <NAME>. See included LICENSE file.
#define DRED_CONTROL_TYPE_TEXT_EDITOR "dred.editor.text"
typedef struct dred_text_editor dred_text_editor;
#define DRED_TEXT_EDITOR(a) ((dred_text_editor*)(a))
struct dred_text_editor
{
// The base editor.
dred_editor editor;
// The text engine.
... |
//---------------------------------------------------------------------------
//
// Module: debug.h
//
// Description:
//
//
//@@BEGIN_MSINTERNAL
// Development Team:
// <NAME>
//
// History: Date Author Comment
//
//@@END_MSINTERNAL
//---------------------------------------------------... |
#define _GNU_SOURCE
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <limits.h>
#include <time.h>
#include <pcap.h>
#include <sys/stat.h>
#include <stdio_ext.h>
#include "common.h"
#define MAGIC_PCAP 0xa1b2c3d4
#define MAGIC_PCAP_SWAPPED... |
/*Assignment No.B18
Write C++ program to store set of negative and positive numbers using linked list.
Write functions
a) Insert numbers
b) Delete nodes with negative numbers
c) To create two more linked lists using this list, one containing all positive
numbers and other containing negative numbers
d) For two lists ... |
/*
Copyright (c) 2009-2013 Genome Research Ltd.
Author: <NAME> <<EMAIL>>
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... |
/*
Copyright (C) 2015, David "Davee" Morgan
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, dist... |
#include "effect.h"
#include "blitter.h"
#include "copper.h"
#include "memory.h"
#include <stdlib.h>
/* Add tile sized margins on every side to hide visual artifacts. */
#define WIDTH (256 + 32)
#define HEIGHT (256 + 32)
#define DEPTH 2
#define TILESIZE 16
#define TILES (WIDTH / TILESIZE)
#define ROTATION ... |
#include "detect.h"
static int DetectClickPoint(LPWININFO lpItem, HWND hWindow, POINT *lpPoint);
static void DetectEdit(LPWININFO lpItem, HWND hWindow);
static void DetectStandardButton(LPWININFO lpItem, HWND hWindow);
static void DetectWindowCaption(LPWININFO lpItem, HWND hWindow);
static void FindDialogProps ... |
/* Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. */
#pragma once
#include "dx_azure_iot.h"
#include "dx_config.h"
#include "dx_deferred_update.h"
#include "dx_gpio.h"
#include "dx_i2c.h"
#include "dx_intercore.h"
#include "dx_json_serializer.h"
#include "dx_terminate.h"
... |
/**
* \file filter_util.c
* \brief Filtering utility functions
* \author <NAME> <<EMAIL>>
*
* Copyright (c) 2012-2013, <NAME>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify it
* under, at your option, the terms of the GNU General Public License as
* publishe... |
/* $OpenBSD: cyreg.h,v 1.2 1996/11/28 23:27:49 niklas Exp $ */
/* $FreeBSD: cyreg.h,v 1.1 1995/07/05 12:15:51 bde Exp $ */
/*-
* Copyright (c) 1995 <NAME>.
* All rights reserved.
*
* Modified by <NAME>, 1996
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted pro... |
/*-------------------------------------------------------------------------
*
* execTuples.c
* Routines dealing with TupleTableSlots. These are used for resource
* management associated with tuples (eg, releasing buffer pins for
* tuples in disk buffers, or freeing the memory occupied by transient
* tupl... |
//
// Created by sebas on 21/11/19.
//
#include "cache_tests.h"
#include "../src/cache.h"
#include "testing.h"
#include <math.h>
void pruebas_get_offset() {
print_test("get offset con cero", get_offset(0) == 0);
print_test("get offset con 31", get_offset(31) == 31);
print_test("get offset con index, sin t... |
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "algrithms.h"
node_t *addtree(node_t *p, char *w,int lvl)
{
int cond;
char *strdup_KR(char *s);
node_t *talloc();
if (p == NULL) {
p = talloc();
p->word = strdup_KR(w);
p->count = 1;
p->lvl=l... |
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "spbutility.h"
/*
Wrap x into the range [0, y). Undefined for a negative or zero y.
Example usage:
spb_fwrapf(10.6f, 3.f) -> 1.6f
spb_fwrapf(-5.5f, 4.f) -> 2.5f
*/
float spb_fwrapf(float x, float y){
float wrapped;
if(x >= 0 && y > 0){
... |
#include "../include/systemCall.h"
uint32_t call(uint32_t id, uint32_t a, uint32_t b, uint32_t c, uint32_t d)
{
uint32_t ret = 0;
uint32_t args[] = {id, (uint32_t)&ret, a, b, c, d};
asm volatile("mov %0, %%ebx;" :: "a" (args) : "%ebx");
asm volatile("int $128");
return ret;
}
//ata
void ataRead(uint8_t device, u... |
/*
* Copyright 2017, Data61
* Commonwealth Scientific and Industrial Research Organisation (CSIRO)
* ABN 41 687 119 230.
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(DATA... |
#include "pub/com.h"
#include "pub/x86.h"
#include "mem/ffit.h"
#include "mem/mmu.h"
#include "mem/pmm.h"
#include "lib/debug.h"
/* first-fit page allocator */
extern const page_allocator_t page_ffit_allocator;
/* free_area_t - maintains a doubly linked list to record free (unused) pages */
free_area_t free_area;
... |
/* Header for starchart 3.x */
/*
*
* $Header: /cvsroot/starchart/starchart/star3.h,v 1.1.1.1 2000/07/27 19:00:12 gfk Exp $
*
*/
/*
*
* StarChart Version 3.2 copyright (c) March 1990 by <NAME>
* original StarChart Software Suite copyright (c) 1987 by <NAME>
*
* All rights reserved. Redistribution granted for ... |
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <assert.h>
#include <stdint.h>
#include <lcm/ringbuffer.h>
// must be power of 2
#define ALIGNMENT 32
#define MAGIC 0x067f8687
typedef struct _lcm_ringbuf_rec lcm_ringbuf_rec_t;
#define EXTRA_RETENTIVE 0
struct _lcm_ringbuf_rec... |
#include "base64.h"
uint8_t charTable[64] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
size_t b64_encodedLength(size_t length)
{
return (length + 2) / 3 * 4;
}
size_t b64_decodedLength(size_t length)
{
return length * 3 / 4;
}
void b64_encodeFirstByte(uint8_t *src, uint8_... |
/**
******************************************************************************
* @file BSP/Src/lcd.c
* @author MCD Application Team
* @brief This example code shows how to use LCD drawing features.
******************************************************************************
* @attention
*
*... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <pthread.h>
#include <errno.h>
#include <sys/socket.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <sys/epoll.h>
#include "config.h"
#include "server.h"... |
/**
* @file
* @ingroup kernel_code
* @author <NAME> <<EMAIL>>
* @copyright GNU Public License.
*
* @brief Gestión de almacenes de memoria
* Este módulo permite crear almacenes de memoria.
* Un almacén de memoria contiene uno o varios almacenes de bloques del tamaño especificado.
* Cuando el almacén se queda ... |
/*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#include <stdio.h>
#include <string.h>
#include <platsupport/chardev.h>
#include <p... |
/*
* Copyright (c) 2012 <NAME>
* 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 a... |
#include <stdarg.h>
#include <string.h>
#include "vm.h"
#include "lex.h"
#define char_isalpha(x) ((x >= 'a' && x <= 'z') || (x >= 'A' && x <= 'Z'))
#define char_isdigit(x) ((x >= '0' && x <= '9'))
static void lex_err(Lexer *l, const char *message, ...)
{
l->failed = 1;
/* Proper error reporting. */
pseu_print(... |
/*
Copyright 2015 Google Inc. 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 wri... |
/* { dg-do run { target mipsisa64*-*-* } } */
/* { dg-mips-options "-mips64 -O2 -mips3d -mhard-float -mgp64" } */
/* Matrix Multiplications */
#include <stdlib.h>
#include <stdio.h>
typedef float v2sf __attribute__((vector_size(8)));
float a[4] = {1.1, 2.2, 3.3, 4.4};
float b[4][4] = {{1, 2, 3, 4},
... |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <syslog.h>
int job_finished = 0;
static void skeleton_daemon()
{
pid_t pid;
/* Fork off the parent process */
pid = fork();
/* An error occurred */... |
#include <float.h>
/**********************************************************************
** GIDX structure.
**
** This is an n-dimensional (practically, the
** implementation is 2-4 dimensions) box used for index keys. The
** coordinates are anonymous, so we can have any number of dimensions.
** The sizeof a GID... |
/*
* Copyright 2016 <NAME>
*
* 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 wr... |
/*************************************************************************
* Microsoft Windows NT *
* *
* Copyright(c) Microsoft Corp., 1994 *
* ... |
/*
MQTT-SN command-line publishing client
Copyright (C) 2013 <NAME>
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,... |
/*-
* Copyright (c) 1998, 2010 <NAME>
* 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 condit... |
/**************************************************************************//**
* @file main.c
* @version V0.10
* @brief Show how to use USCI_I2C Single byte API Read and Write data to Slave.
* Needs to work with USCI_I2C_Slave sample code.
*
* @copyright SPDX-License-Identifier: Apache-2.0
* @... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.