text
stringlengths
3.08k
10.5k
/* * Copyright (c) 2013 Red Hat, Inc. * All Rights Reserved. * * 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. * * This program is distributed in the hope that it would be useful, * but...
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/wait.h> #include <fcntl.h> #include "38sh.h" #include "vector.h" extern char **environ; static void connect(int fd1, int fd2); static void connect2(int fd1, i...
/* See LICENSE file for copyright and license details. */ #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #if defined(__linux) # include <alloca.h> # include <sys/sysinfo.h> #elif defined(__OpenBSD__) # include <sys/types.h> # include <sys/sched.h> # include <sys/sysctl...
// SPDX-License-Identifier: GPL-2.0-only /* * Source for: * Cypress TrueTouch(TM) Standard Product (TTSP) SPI touchscreen driver. * For use with Cypress Txx3xx parts. * Supported parts include: * CY8CTST341 * CY8CTMA340 * * Copyright (C) 2009, 2010, 2011 Cypress Semiconductor, Inc. * Copyright (C) 2012 <NAME> ...
#include "sofa.h" #include "stdio.h" #include "stdlib.h" #include "strings.h" #define PI 3.1415926535897931 //Helpers void printmat(char* title, double mat[3][3]) { printf("%s:\n[[ %e,%e,%e]\n [%e,%e,%e]\n[%e,%e,%e]]\n",title, mat[0][0],mat[0][1],mat[0][2], mat[1][0],mat[1][1],mat[1][2], ...
/***************************************************************************//** * \file cy_trigmux.c * \version 1.10 * * \brief Trigger mux APIs. * ******************************************************************************** * \copyright * Copyright 2016-2018 Cypress Semiconductor Corporation * * Licensed under th...
#include "ptest.h" #include "../mpc.h" void test_grammar(void) { mpc_parser_t *Expr, *Prod, *Value, *Maths; mpc_ast_t *t0, *t1, *t2; Expr = mpc_new("expression"); Prod = mpc_new("product"); Value = mpc_new("value"); Maths = mpc_new("maths"); mpc_define(Expr, mpca_grammar(MPCA_LANG_DEFAULT, " <p...
/* Processed by ecpg (regression mode) */ /* These include files are added by the preprocessor */ #include <ecpglib.h> #include <ecpgerrno.h> #include <sqlca.h> /* End of automatic include section */ #define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y)) #line 1 "num_test.pgc" #include <stdio.h> #include <stdlib.h> #include <p...
// Network.c // Runs on LM4F120 // This test file demonstrates the UART. Download this // program to two different Launch Pads and connect their // UART1s and grounds together. Connect PC4 of the first // board to PC5 of the second board and PC4 of the second // board to PC5 of the first board. Connect the grounds /...
#include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <pthread.h> #include <sys/types.h> #include <signal.h> #define MAX_CLIENTS 100 #define BUFFER_SZ 2048 static _Atomic unsigned int cli_count ...
/* register.c - Handles the Win 3.1 registration library. * * Created by Microsoft Corporation. */ #include "packager.h" TCHAR gszAppName[] = "packager.exe"; /* RegInit() - Prepare the registration database for calls. */ VOID RegInit( VOID ) { CHAR sz[CBMESSAGEMAX]; CHAR szVerb[C...
#include <stdlib.h> #include <stdbool.h> #include <string.h> #include "regs.h" #include "ui.h" #include "utils.h" #include "ublox.h" #if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ #error "This code works only on little endian machines" #endif struct fletcher_state { uint8_t ck_a; uint8_t ck_b; }; #define FLETC...
/* Copyright (C) 2014 Open Information Security Foundation * * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 as published by the Free * Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARR...
/* * Copyright (C) 2011 The Android Open Source Project * * 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 app...
/* ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, 2011,2012,2013 <NAME>. This file is part of ChibiOS/RT. ChibiOS/RT 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 Foundat...
/* Copyright 1993 <NAME>. * Permission granted to Spec to use and distribute as a computer benchamrk * permission is not granted to use or modify this code for any * purpose other than benchmarking or computer system performance tuning. * * This program is available (with a user interface) for: * IBM-PC/DOS from ...
/* Copyright (C) 2011 The Regents of the University of California * See README in this or parent directory for licensing information. */ /* agpMergeChromScaf - Combines chrom.agp and scaffold.agp * <NAME> 2009-06-19 * Produces a combined agp file from the chrom.agp and * scaffold.agp, merging only scaffolds ...
/*- * Copyright (c) 1996, <NAME> (<EMAIL>) * All rights reserved. * * Copyright (c) 2000 <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...
#include<stdio.h> #include<stdlib.h> #include<pthread.h> #include<sys/sysinfo.h> #include<string.h> #include<assert.h> #include<sys/stat.h> #include<fcntl.h> #include<unistd.h> #include<sys/mman.h> static int NUM_THREADS; static int NUM_FILES; char ***output; int ***count_output; char* final_result; int* final_count; ...
/* $NetBSD: fdreg.h,v 1.1 1997/10/14 06:48:55 sakamoto Exp $ */ /*- * Copyright (c) 1991 The Regents of the University of California. * 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....
/* * AMGlib Template * Powered by Andresmargar * from SCENEBETA */ // Includes AMG #include <AMG/AMGLib.h> // Module info AMG_MODULE_INFO("AMG_Model", 0, 1, 1); // Variables adicionales // Additional variables float Angle1 = 0; float SCALING = 1; float SCALING1 = 1; int Ob = 0; float ALT = -15.0; float CAM = 28;...
/* Defines and externs of general interest */ /* $Id$ */ #include <stdio.h> #include <stdlib.h> #include <stdint.h> /********* PRIVATE/static *********/ #define PRIVATE static /* or not */ /********* The internal data types ********/ #define UNSIGNED /* the normal case */ #ifdef UNSIGNED /* The EM pointer ...
/* Native-dependent code for Solaris x86. Copyright 2004 Free Software Foundation, Inc. This file is part of GDB. 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 ...
#include <stdio.h> #define LINES 10 #define COLS 10 typedef struct {int i; int j;} cords; int increment_energy_level(int matrix[][COLS], int i_flashed, int j_flashed) { int flashes = 0; flashes++; if (i_flashed > 0 && matrix[i_flashed - 1][j_flashed] != 0) { // up matrix[i_flashed - 1][...
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you...
#include <stdio.h> #include <stdlib.h> #include "table.h" #define DEC_SIZE 65535 void rootDict(dictionary_t *); void compress(FILE *, FILE*); void decompress(FILE *, FILE*); int main(int argc, char* argv[]){ FILE *in, *out; if(argc != 4){ printf("Error! Usage: ./lab3 [in-file] [out-file] ['c' or 'd']\n"); ...
#include <hal/watchdog.h> #include <fsw/clock.h> #include <fsw/clock_init.h> #include <fsw/command.h> #include <fsw/debug.h> #include <fsw/spacecraft.h> #include <fsw/telemetry.h> enum { UPLINK_STREAM_CAPACITY = 0x4000, DOWNLINK_STREAM_CAPACITY = 0x4000, // physical component addresses PADDR_RADIO = 4...
// Copyright 2016-2019 Espressif Systems (Shanghai) PTE LTD // // 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 a...
/* * max5487.c - Support for MAX5487, MAX5488, MAX5489 digital potentiometers * * Copyright (C) 2016 <NAME> <<EMAIL>> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * */ #i...
/* * playlist.c * * Created on: 24 mag 2016 * Author: <NAME> */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <stdbool.h> #include "playlist.h" track_t inserisci_dettagli(void){ track_t temp; printf("Inserisci artista ---> "); gets(temp.artista); printf("Inser...
/* * Testcase for object prototype manipulation * * Test also prototype loops. The Ecmascript primitives like Object.create() * and Object.setPrototypeOf() guard against creating a prototype loop (as * required by the specification) but no such safeguard is used for the C API. * A prototype loop is expected...
#include <pebble.h> #include "magic.h" static Layers* get_layers (Layers* layers) { static Layers* stored; if (layers) stored = layers; return stored; } static void send_code(uint8_t code) { DictionaryIterator* di = NULL; app_message_outbox_begin(&di); dict_write_uint8(di, K_PEBBLE, code); dict_write_end(di); ...
/* * Copyright (C) <NAME> 1995-1999 * * This software may be distributed either under the terms of the * BSD-style license that accompanies tcpdump or the GNU GPL version 2 * or later */ /* for netdissect_options */ #include "netdissect.h" /* the complete */ #define SMBmkdir 0x00 /* create directory */ #...
/* @@@LICENSE * * Copyright (c) 2007-2013 LG Electronics, Inc. * * 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 appli...
#include <sgx_error.h> #include <stdint.h> #include <string.h> #include <math.h> #include "stdio.h" #include "enclave_t.h" struct _FILE { unsigned mode; uintptr_t untrusted; size_t bytes_left; unsigned char *buffer; unsigned char *curp; }; FILE *stdout = NULL; FILE *stdin = NULL; FILE *stderr = N...
/**************************************************************************//** * @file main.c * @version V3.00 * $Revision: 2 $ * $Date: 16/10/25 4:30p $ * @brief Show how to use ACMP0 to trigger Timer capture event. * @note * Copyright (C) 2016 Nuvoton Technology Corp. All rights reserved. ***...
#define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward d...
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <omp.h> #include <math.h> #include <unistd.h> #include <sys/types.h> #include "parseFlags.h" #define maxlength 1024 typedef struct { double x; double y; } coordinates; typedef struct { coordinates position; coordinates velocity; double mass;...
/** * Syspro Project 3 * Written By <NAME> sdi1800119 **/ /* ** BF Implementation ** Implemented by <NAME> sdi1800119 */ #include "BF.h" #define BITS_PER_UINT8_T 8 typedef unsigned char uint8_t; struct bloom_filter { uint8_t *bit_string; // The actual bit string for the bloom filter implementation ...
/* * features.c * * Created on: 24-dic-2008 * Author: valabau */ #include <stdio.h> #include <ctype.h> #include <string.h> #include <prhlt/constants.h> #include <prhlt/trace.h> #include <prhlt/gzip.h> #include <prhlt/utils.h> #include <viterbi/features.h> #ifdef MAX_LINE #undef MAX_LINE #endif #define MAX...
/* libmumblelink.c -- mumble link interface Copyright (C) 2008 <NAME> <<EMAIL>> This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this softwar...
#include <stdio.h> #define NILE_INCLUDE_PROCESS_API #include "nile.h" #include "gezira.h" #include "gezira-image.h" #include "utils/all.h" #define NBYTES_PER_THREAD 1000000 #define WINDOW_WIDTH 600 #define WINDOW_HEIGHT 600 #define NFLAKES 300 #define FLAKE_ALPHA 0.7 #define FLAKE_RED 0.8 #define FLAKE_GREEN 0.9 #d...
/* -*- mode:c; tab-width:8; c-basic-offset:8; indent-tabs-mode:nil; -*- */ /* Copyright (C) 2017 by <NAME> <<EMAIL>> This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either versio...
/* libsmp * Copyright (C) 2017 Actronika SAS * Author: <NAME> <<EMAIL>> * * 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...
// Standard library includes. #include <stdint.h> #include <stdlib.h> // Vendor-provided device header file. #include "stm32l4xx.h" // HAL includes. #include "hal/adc.h" #include "hal/dma.h" #include "hal/gpio.h" #include "hal/rcc.h" #include "hal/spi.h" #include "hal/tim.h" // BSP includes. #include "ili9341.h" #inclu...
/* This file was generated by getpir.c, do not modify! (but if you do, please run checkpir on it to verify) Contains the IRQ Routing Table dumped directly from your memory , wich BIOS sets up Documentation at : http://www.microsoft.com/hwdev/busbios/PCIIRQ.HTM */ #include <console/console.h> #include <device/...
/* <NAME> ** A set of functions to provide histogram functionality. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "histogram.h" #include "gnuplot.h" /* A struct to contain the information for each histogram */ typedef struct { char hname[250]; /* Histogram name. */ int num_bins; /* Number...
#include "core/io.h" #include <stdlib.h> #include <string.h> #define ANALOG_PINS 6 #define ANALOG_BUFFER_SIZE 5 #define DIGITAL_PINS 13 #define DIGITAL_BUFFER_SIZE 5 #define SERIAL_PINS 1 #define SERIAL_BUFFER_SIZE 5 pin_mode_t pin_mode[DIGITAL_PINS]; void set_pin_mode(dpin_t pin, pin_mode_t pm) { pin_mode[pin] = p...
/************************************************************************** * Copyright (c) 2001 by <NAME>. All rights reserved. * * * * Redistribution and use in source and binary forms, with or without * * modification, are permi...
/* * File: main.c * Author: <NAME> * Author: <NAME> * Author: <NAME> * * Created on April 17, 2021, 2:56 AM */ #include <xc.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include "config.h" #include "lcd.h" #define MOTD_S "Vault System" #define PORTB_NOMINAL 0xF0 #define PASSWD_LENGTH 5 /...
#include <stdio.h> #include <string.h> #include <stdlib.h> #include "cloc.h" /* setup key */ int ae_init(ae_cxt* cxt, const byte* userkey, int keylen) { if(keylen != STATE_LEN){ return KEY_ERROR; } cxt->userkey = (byte*)userkey; cxt->pt_ekey = &(cxt->ekey); AES_set_encrypt_key(userkey, keylen*8, cxt->pt_ekey);...
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <signal.h> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/time.h> #include <sys/ioctl.h> #include <sys/socket.h> #include <net/if.h> #include <net/bpf.h> #include "common.h" #include...
// Standard headers #include <stdio.h> #include <stdlib.h> // Internal headers #include "direction.h" #include "position.h" #include "spy.h" // Main header #include "defender.h" /*----------------------------------------------------------------------------*/ /* STRATEGIES DEFINITIONS ...
/* * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved * * 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...
/* * Generic Options Support Header File * * Copyright (c) 2001 <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 * notic...
/***************************************************************************//** * @file * @brief SWO debug component for Silicon Labs Bootloader. ******************************************************************************* * # License * <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b> **********...
/* * NASA Docket No. GSC-18,370-1, and identified as "Operating System Abstraction Layer" * * Copyright (c) 2019 United States Government as represented by * the Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the...
/* * Copyright (c) 2007 <NAME> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is d...
/* * libgit2 "describe" example - shows how to describe commits * * Written by the libgit2 contributors * * To the extent possible under law, the author(s) have dedicated all copyright * and related and neighboring rights to this software to the public domain * worldwide. This software is distributed without any...
/*- * Public Domain 2014-2016 MongoDB, Inc. * Public Domain 2008-2014 WiredTiger, Inc. * * This is free and unencumbered software released into the public domain. * * Anyone is free to copy, modify, publish, use, compile, sell, or * distribute this software, either in source code form or as a compiled *...
#include <stdio.h> #include <math.h> #include <interpreter.h> #include <io.h> int memory[MEM_SIZE] = {0}; int accumulator = 0; int instruction_counter = 0; int instruction_register = 0; int operation_code = 0; int operand = 0; int last_memory_position_used = 0; void type(void) { int opc; cleanup(); printf...
#include "NovatelPacket.h" #include "NovatelProtocol.h" #include "NovatelStructures.h" #include "fielddecode.h" #include "fieldencode.h" //! Generate CRC from a single word of data static unsigned long CRC32Value(int i); //! Generate CRC from a block of data static unsigned long CalculateBlockCRC32(unsigned long ulCo...
/** * @file * @brief Command-line macros and macros for porting QP */ /*! The preprocessor switch to disable checking assertions */ /** * When defined, Q_NASSERT disables the following macros #Q_ASSERT, * #Q_REQUIRE, #Q_ENSURE, #Q_INVARIANT, #Q_ERROR as well as * #Q_ASSERT_ID, #Q_REQUIRE_ID, #Q_ENSURE_ID, #Q_INVARIANT...
#include <stdio.h> #include <stdio.h> #include <string.h> #include <pthread.h> #include <ctype.h> #include <stdlib.h> #include <unistd.h> #include <time.h> #include <semaphore.h> #define TRUE 1 /* *all variables of the amount of buffers, producer and consumer threads *amount of consumers and extra c...
#include"src/include/system.h" #include"src/include/PB.h" extern db_server DBServer; void db_mk_lock(int index) { unsigned char expected = 0; while (!__atomic_compare_exchange_1(DBServer.pbInfo.db_pb_access + index, &expected, 1, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))...
/* ** Copyright (c) 1997-2001 <NAME> (<EMAIL>) ** All rights reserved. ** ** Get the latest Ficl release at http://ficl.sourceforge.net ** ** I am interested in hearing from anyone who uses Ficl. If you have ** a problem, a success story, a defect, an enhancement request, or ** if you would like to contribute to the Fi...
/* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 * <NAME> <<EMAIL>> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in * the packaging of this file. * * Alternat...
/** * @file */ /****************************************************************************** * Copyright (c) Open Connectivity Foundation (OCF), AllJoyn Open Source * Project (AJOSP) Contributors and others. * * SPDX-License-Identifier: Apache-2.0 * * All rights reserved. This program and the acco...
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int c2i(char c) { if ((int) c == 32) return 36; if ((int) c <= 122 && (int) c >= 97) return ((int) c) - 97; if ((int) c <= 57 && (int) c >= 48) return ((int) c) - 48 + 26; return 0; } char i2c(int i) { if (i == 36) return ' '; ...
/* graphics.c */ #include "graphics.h" #include <ftw_science.h> #include <ftw_std.h> extern int side_view; extern int wsize_x, wsize_y, wsize_z; extern int particle_scale; extern double box_x, box_y, box_z; extern int change_flag; extern int graphics; extern int number_of_molecules; extern int bg_color; extern int fg...
// Copyright(C) 2018 <NAME> #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <stdbool.h> #include <unistd.h> #include <string.h> #include <errno.h> #include <sys/mman.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> static char *cmd_name = NULL; static uint32_t map_base = 0x1800...
/* Tests for LFS support in neon Copyright (C) 2004-2006, <NAME> <<EMAIL>> 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 ...
/** * exception.c * * Exception handling code (part 2) */ #include <stdio.h> #include <stdlib.h> #include <psx.h> #define DPCR *((unsigned int*)0x1f8010f0) #define DICR *((unsigned int*)0x1f8010f4) #define IPENDING *((volatile unsigned int*)0x1f801070) #define IMASK *((volatile unsigned int*)0x1f80107...
#pragma once /* ** Two Level Segregated Fit memory allocator, version 3.1. ** Written by <NAME> ** http://tlsf.baisoku.org ** ** Based on the original documentation by <NAME>: ** http://www.gii.upv.es/tlsf/main/docs ** ** This implementation was written to the specification ** of the document, therefore no...
#ifdef __APPLE__ # include <crt_externs.h> # define environ (*_NSGetEnviron()) #else extern char** environ; #endif #include "duktape.h" #include "build.h" #include "internal.h" #include "version.h" static const char* default_search_paths[] = { "/usr/lib/sjs/modules", "/usr/local/lib/sjs/modules", "~/.lo...
/* * linux/fs/proc/inode.c * * Copyright (C) 1991, 1992 <NAME> */ #include <linux/sched.h> #include <linux/proc_fs.h> #include <linux/kernel.h> #include <linux/mm.h> #include <linux/string.h> #include <linux/stat.h> #include <linux/locks.h> #include <linux/limits.h> #include <asm/system.h> #include <asm/segmen...
/* * POSIX tsearch(3) example * 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 a...
/* * Definitions and structures for IRAF/VMS Kernel. */ #define VMS4 /* VMS Version 4.xx */ #define NOKNET /* no networking in kernel (see iraflibc:knames.h) */ #define NODEBUG /* DEBUG prints VMS error messages, statuses, etc. */ #define import_knames /* Standard IRAF definitions */ #define import_spp #inclu...
#include "algorithms.h" void swap(int *array, int i, int j) { if (i != j) { int temp = array[i]; array[i] = array[j]; array[j] = temp; } } void print_array(int *array, int size) { int i; for (i = 0; i < size; i++) printf("%d ", array[i]); printf("\n"); } int array_sum(int *...
#pragma once #include <stddef.h> #include <stdint.h> #include <stdarg.h> #include <x86intrin.h> #define _In_ #define _In_z_ #define _In_opt_ #define _In_reads_bytes_(x) #define _Out_ #define _Outptr_ #define _Out_writes_bytes_(x) #define _Out_writes_bytes_all_(x) #define _Printf_format_string_ #define NULL ((void*)0...
/*********************************************************************** * Copyright (c) 2015 - 2017, Intel Corporation * * 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. Redistribut...
/* * Copyright (c) 2010-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: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions...
#include <xbook/walltime.h> #include <xbook/clock.h> #include <xbook/schedule.h> #include <xbook/debug.h> #include <xbook/safety.h> walltime_t walltime; const char month_day[] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; int walltime_is_leap_year(int year) { if (year % 4) return 0; if (year % 400) retu...
/* * Copyright (c) 2018 <NAME> <<EMAIL>> * * Permission to use, copy, modify, and 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 copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCL...
#include "ARM_mfcc.h" #include "arm_math.h" #include "CycleCounter.h" #include <string.h> #include <math.h> #include <stdlib.h> struct ARM_MFCC mfcc_inst; void ARM_MFCC_Init(struct ARM_MFCC * mfcc){ for (int i = 0; i < frame_len; i++) mfcc->window_func[i] = 0.5 - 0.5*cosf(M_2PI * ((float)i) / (frame_len)); ...
#include <stdio.h> #include <string.h> #include <malloc.h> #include <stdlib.h> #include <unistd.h> #include <sys/time.h> /* local objects */ #include "../error.h" #include "../aldl-io.h" #include "../loadconfig.h" #include "../useful.h" typedef struct _datastreamer_conf { dfile_t *dconf; /* raw config data */ int...
#include "process.h" #include "handle.h" #include <assert.h> #if defined(HAVE_ATTRIBUTE_LIST) #include <stdlib.h> REPROC_ERROR static handle_inherit_list_create(HANDLE *handles, int amount, LPPROC_THREAD_ATTRIBUTE_LIST *result) { assert(handles); assert(amount >= 0); assert(re...
#include <stdio.h> #include <string.h> #include <ctype.h> void squeeze(char s1[], char s2[]) { int i, j, k; for (i = 0 ; s2[i] != '\0' ; ++i) { for (k = j = 0 ; s1[j] != '\0' ; ++j) { if (s1[j] != s2[i]) s1[k++] = s1[j]; } s1[k] = '\0'; } } int any (char...
/* * This file is part of MPlayer. * * MPlayer 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. * * MPlayer is distributed in th...
// // Copyright (c) 2017 The Khronos Group Inc. // // 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 la...
// SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2012-2015, 2017-2018, The Linux Foundation. * All rights reserved. */ #include <linux/clk.h> #include <linux/clk/clk-conf.h> #include <linux/err.h> #include <linux/delay.h> #include <linux/of.h> #include <drm/drm_print.h> #include "dpu_io_util.h" void msm_...
#include <stdlib.h> #include <string.h> #include <stdio.h> typedef struct str_t { char *bytes; int len; int cap; } str_t; typedef struct strnode_t { str_t* str; struct strnode_t *next; } strnode_t; // Return target exponential buffer growth cap. int buf_cap(int len) { int cap = 1; while (...
#include <stdlib.h> #include <ncurses.h> #include <time.h> #include "gfx.h" #define IDX(val) (val - 1) #define SETBIT(A, n) (A |= 1 << n) #define CLEARBIT(A, n) (A &= ~(1 << n)) #define WIN_COND(size) ((1 << ((size * size) - 1)) - 1) typedef struct block_t { unsigned char val; unsigned char correct_...
#include <stddef.h> #include <stdio.h> #include <stdint.h> #include <stdbool.h> #include <string.h> #include <unistd.h> #include <sys/time.h> #include "isbilen.h" static inline uint8_t checksum_count(const sves_isbilen_t * const snowflake) { uint8_t cvalue = 0; for (int i = 0; i < 4; i++) cvalue += (snowfla...
/* * MIT License * * Copyright (c) 2019 <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 with the Software without restriction, including without limitation the * rights to use, copy, modify,...
/* $Id$ */ /* * Copyright (c) 2003 <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 * notice, this...
// Copyright 2015 Heidelberg University Copyright and related rights are // licensed under the Solderpad Hardware License, Version 0.51 (the "License"); // you may not use this file except in compliance with the License. You may obtain // a copy of the License at http://solderpad.org/licenses/SHL-0.51. Unless // requir...
/* * remote.c * * Created on: 04/08/2016 * Author: xavier */ #include <stdio.h> #include <string.h> #include <unistd.h> #include <stdarg.h> #include "lwip/err.h" #include "lwip/tcp.h" #include "remote.h" #include "usb_uart/usb_uart.h" #define OPENAT_SERVER_PORT 22 #define MAX_BUFFER_SIZE 1024 struct tcp...
#include <string.h> #include "usart.h" #include "spi.h" #include "gpio.h" #include "ssd1306_oled.h" HAL_StatusTypeDef OLED_Init(OLED_HandleTypeDef *oled) { OLED_Reset(oled); OLED_RegInit(oled); OLED_Flush(oled); return HAL_OK; } HAL_StatusTypeDef OLED_RegInit(OLED_HandleTypeDef *oled) { OLED_Writ...
#include <stdlib.h> #include <string.h> #include "sort.h" #include "common.h" #define valid_para(base, n, size, cmp) ((base) && (n) > 1 && (size) > 0 && (cmp)) static size_t _partition(void *base, size_t n, size_t size, cmpfunc_t cmp, void *arg) { void *pivot = 0; size_t left = 0; size...