text stringlengths 3.12k 18.7k |
|---|
/*
* Copyright 2017 International Business Machines
*
* 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 applicab... |
/**
This program is simple demonstration of the LEDs
Hardware required:
- SLMX4-HW
- epam-x4 (or other pin-compatible x4 module)
This program uses the Red, Green, and RGB LED in a few modes. Under the "Modes"
section below, uncomment one mode and comment out all the others. _Some modes
can be mixed though._
Modes:
*... |
/*
* M_APM - primenum.c
*
* Copyright (C) 1999 - 2007 <NAME>
*
* Permission to use, copy, and distribute this software and its
* documentation for any purpose with or without fee is hereby granted,
* provided that the above copyright notice appear in all copies and
* that both that copyrigh... |
/*
* Copyright 2014-2016 CyberVision, 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 law o... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <stdint.h>
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
struct img_dt {
int x, y, pixsz;
unsigned char **img;
unsigned char *flat;
ch... |
/******************************************************************************
* Jacobi2D benchmark
* Diamond tiling parameterized by hand.
*
* Copied Jacobi2D-DiamondSlabISCCParam-OMP-test.c to get similar format
* to other drivers and then put in parameterized loop bounds.
*
* Look for the notes titled "Param... |
/**
* eCryptfs: Linux filesystem encryption layer
*
* Copyright (C) 2007 International Business Machines Corp.
* Author(s): <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 Found... |
#include "vp_tree.h"
#include "v1.h"
//Copies vpt to prev_vpt
void copy_vp_tree(vp_tree *vpt, vp_tree *prev_vpt){
if(prev_vpt->n == 0){
prev_vpt->id = (int *)malloc(vpt->n * sizeof(int));
prev_vpt->p = (double *)malloc(vpt->n * vpt->d * sizeof(double));
prev_vpt->mu = (double *)malloc(vpt... |
/*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg is distributed... |
/* Copyright (c) 2006, Nokia 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:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of con... |
#include <math.h>
#include <stdlib.h>
#define IX(x, y, z) ((x) + (y) * N + (z) * N * N)
struct FluidCube {
int size;
float dt;
float diff;
float visc;
float *s;
float *density;
float *Vx;
float *Vy;
float *Vz;
float *Vx0;
float *Vy0;
float *Vz0;
};
struct... |
/* Copyright (C) 2007-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... |
/*
* ioarena: embedded storage benchmarking
*
* Copyright (c) <NAME>
* Copyright (c) <NAME>
* BSD License
*/
#include "ioarena.h"
int ia_configinit(iaconfig *c) {
c->driver = NULL;
c->driver_if = NULL;
c->drv_opts = NULL;
c->path = strdup("./_ioarena");
if (c->path == NULL)
return -1;
c->count ... |
/***************************************************
* file: userconfig/uc_isa.c
*
* Copyright (c) 1996 <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. Redistribut... |
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#define LIC leastIndexCheckable
/**********Utils*************/
int stringify(char t[], char at, char *mda[]){
int i = 0, i1 = 0;
char c;
*(mda+(i1++)) = t;
while((c = t[i]) != '\0'){
if(c == at){
t[i] = '\0';
*(mda+i1) = t+i+1;
i1++;
}
i++;
}
retur... |
/* Copyright (C) 2010 Ion Torrent Systems, Inc. All Rights Reserved */
#include <zlib.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include "../../util/tmap_alloc.h"
#include "../../util/tmap_vec.h"
#include "../../util/tmap_rand.h"
#include "../../seq/tmap_seq.h"
#include "../../index/tmap_refseq.h"
#... |
/*
* Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
*
* 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 th... |
/*
* Copyright (c) 1996, <NAME> <<EMAIL>>
* Copyright (c) 2008, <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... |
/**************************************************************************
*
* Copyright 2003 Tungsten Graphics, Inc., <NAME>, Texas.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software")... |
/*
* SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/periph_ctrl.h"
#include "esp_crypto_lock.h"
#include "hal/ds_... |
/*
* rexep256.c - Cartridge handling, REX EP256 cart.
*
* Written by
* <NAME> <<EMAIL>>
*
* This file is part of VICE, the Versatile Commodore Emulator.
* See README for copyright notice.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public... |
/*
* All the Unit Tests are here, grouped together in a static table.
*
* Each implementation of a single Unit Test operates with 'n' different elements
* and all are based on the assert(3) to check for assertions.
*/
/* System headers */
#include <assert.h>
/* Project headers */
#define NEED_RL_TYPEDEF
#includ... |
/* $Header: /home/schj/src/vamps_0.99g/src/deffile.lib/RCS/sl_inter.c,v 1.6 1999/01/06 12:13:01 schj Alpha $
*/
/*
* $RCSfile: sl_inter.c,v $
* $Author: schj $
* $Date: 1999/01/06 12:13:01 $
*/
/*F:sl_inter.c
* S-Lang interface for libdef
*
* S-Lang intrinsics to process .ini type files
*/
static char R... |
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 <NAME>
**********/
/*
* This file defines the BJT data structures that are
* available to the next level(s) up the calling hierarchy
*/
#include "spice.h"
#include <stdio.h>
#include "devdefs.h"
#include "bjtdefs... |
/*
* Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1997-2001 Internet Software Consortium.
*
* 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 noti... |
/*
* Copyright (c) 2016, Alliance for Open Media. All rights reserved
*
* This source code is subject to the terms of the BSD 2 Clause License and
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
* obtain it at w... |
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "groupsAlgorithm_c.h"
#include "dbscan_c.h"
#include "vector_c.h"
// #define PRINT 1
// #define DEBUG 1
extern vector* unassigned_points;
extern Point** points;
extern int dim;
extern int num_p... |
#include <math.h>
#include <stdlib.h>
#include <memory.h>
#include <stdio.h>
#include "omp.h"
/* C-OMP implementation of FGP-TV [1] denoising/regularization model (2D/3D case)
*
* Input Parameters:
* 1. Noisy image/volume [REQUIRED]
* 2. lambda - regularization parameter [REQUIRED]
* 3. Number of iterations [OPTI... |
#include "treadmill-spawn-common.h"
#include <curl/curl.h>
#include <getopt.h>
#include <jansson.h>
#include <stdbool.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>
#ifndef FSTRACE
#define FSTRACE "treadmill-fstrace"
#endif
#define MAX_RE... |
/*
* Convert an outfile into a main 32k binary + multiple 16k expansion banks
*
* Elements taken from makebin distributed with gbdk/sdcc with the following
* notice:
*
* Copyright (c) 2000 <NAME>
* Copyright (c) 2010 <NAME>
* Copyright (c) 2012 <NAME>
*
* This software is provided 'as-is',... |
/*
* cutils.c module.
*
* Miscellaneous functions to speed up the IMDbPY package.
*
* Contents:
* - pyratcliff():
* Function that implements the Ratcliff-Obershelp comparison
* amongst Python strings.
*
* - pysoundex():
* Return a soundex code string, for the given string.
*
* Copyright 2004-2009 <NA... |
/*
* Copyright (c) 2002-2007 Hypertriton, Inc. <http://hypertriton.com/>
* 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 copyrigh... |
#include "common.h"
// Transition all UD QPs to RTS
int modify_dgram_qp_to_rts(struct ctrl_blk *ctx) {
int i;
for (i = 0; i < ctx->num_local_dgram_qps; i++) {
struct ibv_qp_attr dgram_attr = {
.qp_state = IBV_QPS_RTR,
};
if (ibv_modify_qp(ctx->dgram_qp[i], &dgram_attr, IBV_QP_STATE)) {
f... |
/* COMP2215 15/16: Task 02---MODELANSWER */
#include "pokedex.h"
#define PKMN_NO 9
#define SPRITE_SIZE 64
#define BG_COLOUR WHITE_SMOKE
#define FG_COLOUR BLACK
struct Pokemon *pkmn;
int8_t detail;
int8_t selected;
int8_t enc_delta(void);
volatile int8_t delta;
void format_string(char *fmt, va_list args, char *fo... |
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file : main.c
* @brief : Main program body
******************************************************************************
* @attention
*
* <h2><center>© Copyri... |
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> ... |
/*****************************************************************************
*
* \file
*
* \brief MCI driver for AVR32 UC3.
*
* This file contains basic functions for the AVR32 MCI, with support for all
* modes, settings and clock speeds.
*
* Copyright (c) 2009-2014 Atmel Corporation. All rights reserved.
*... |
#include"gen.h"
int unaryOp(int op, int var) {
if(op == OP_ADD) return var;
if(op == OP_DEREF) return derefVar(var);
if(op == OP_REF) return refVar(var);
int ty = llDerefTy(lVarType(var));
int dvar;
int tmp_var;
if(op == OP_INC || op == OP_DEC) {
if(llIsRef(ty)) {
dvar = castVar(var, TY_I64)... |
#include "stdio.h"
#include "stdlib.h"
#include "ctype.h"
#include "limits.h"
#include "float.h"
#include "math.h"
#define eprintf printf
void test1(void)
{
char *str = "Edmond";
char *str2 = "<NAME>";
int d = 365;
double f1 = 12.567, f2 = 5666.56789;
double f3 = 999.99999, f4 = 899.9999;
eprintf("\n---------... |
/*
* Mesa 3-D graphics library
*
* Copyright (C) 2009 VMware, Inc. All Rights Reserved.
*
* 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 limit... |
/*
MPI Dynamic Mandelbort sort
*/
#include <stdlib.h>
#include <mpi.h>
#include <X11/Xlib.h>
#include <stdio.h>
#include <omp.h>
#define data_tag 100
#define result_tag 101
#define terminate_tag 110
struct timeval tv1, tv2;
double t = 0;
typedef struct complextype
{
double real, imag;
} Compl;
int main(int ar... |
/*
* Copyright (c) 2007 - 2021 <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, copy, modify, merge, publi... |
/* pgcnsc.f -- translated by f2c (version 20020208).
You must link the resulting object file with the libraries:
-lf2c -lm (in that order)
*/
#include "f2c.h"
/* Table of constant values */
static integer c__1 = 1;
static integer c__3 = 3;
static integer c__2 = 2;
static integer c__4 = 4;
/* Subroutine */ int... |
#include "game_sdl.h"
//---------------------------------------------------------------------
void init_grid (grid* g){
int i,j,n,s,alive;
printf("Enter the size to be in the matrix: ");
scanf("%d", &s);
allocate_grid(s,g);
printf("Enter the number of alive cells in the matrix: ");
scanf("%d", &alive);
fo... |
#include "bios_disk_services.h"
#include "bios_call.h"
#include "common/log.h"
#include "common/string.h"
#include "common/minmax.h"
#undef MSG_FMT
#define MSG_FMT(msg) "BIOS-IO: " msg
#define DISK_BUFFER_CAPACITY 128
static struct disk disks_buffer[DISK_BUFFER_CAPACITY];
static size_t disk_count = 0;
#define TRANSF... |
/*
* complice.c : pre-processor for cmplc++, the real compiler.
* On UNIX this is done by a shell script, but
* Windows is limited by the number of arguments.
*/
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
#define _CRT_SECURE_NO_DEPRECATE 1
#define _CRT... |
/*
* This file is part of Espruino, a JavaScript interpreter for Microcontrollers
*
* Copyright (C) 2013 <NAME> <<EMAIL>>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/... |
/* vim: tabstop=4 shiftwidth=4 noexpandtab
* This file is part of ToaruOS and is released under the terms
* of the NCSA / University of Illinois License - see LICENSE.md
* Copyright (C) 2018 <NAME>
*
* Signed Distance Field text rasterization library
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/shm.h>... |
/*
* Copyright (C) 2019-2020 Alibaba Group Holding Limited
*/
#include <yoc_config.h>
#include <yoc/aui_cloud.h>
#include "aui_cloud_imp.h"
#include <librws.h>
#include "avutil/straight_fifo.h"
#define TAG "CLOUD_XFYUN_RASR"
#define PER_WSIZE ((16000 / 1000) * (16 / 8) * 40)
typedef enum {
ASR_STOPED,
ASR_... |
/*
* This software is copyrighted as noted below. It may be freely copied,
* modified, and redistributed, provided that the copyright notice is
* preserved on all copies.
*
* There is no warranty or other guarantee of fitness for this software,
* it is provided solely "as is". Bug reports or fixes may be sent
... |
/*subfile: prtyp.h *********************************************************/
/* */
/* This software was developed at the National Institute of Standards */
/* and Technology by employees of the Federal Government in the */
... |
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <dirent.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
#include "fsearch.h"
#include "gui.h"
char* file;
char ... |
/*--------------------------------------------------------------------------
File : Vectors_CC3200.c
Author : <NAME> Oct. 3, 2014
Desc : Interrupt vectors for ARM Cortex-M4 TI CC3200 specific
Copyright (c) 2014, I-SYST inc., all rights reserved
Permission to use, copy, modify, and distribute t... |
/*
* Copyright (c) 1999-2005 <NAME>, <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, copy, modify, merge,... |
/* ====================================================================
* Copyright (c) 1999-2004 Carnegie Mellon University. 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. Redi... |
/*
cpymain.c
>mingw32-make -f makefile.tdmgcc64
*/
#ifndef UNICODE
#define UNICODE
#endif
#include <Python.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <numpy/arrayobject.h>
#include <math.h>
#define BUFSIZE 4096
void prepare_numpy()
{
import_array(); // IMPORTANT: this must be cal... |
/***************************************************************************
* *
* LIBDSK: General floppy and diskimage access library *
* Copyright (C) 2001-2,2005 <NAME> <<EMAIL>> *
* ... |
/*
Extracts a list of attribute names and uniform names from a set of GLSL shaders.
Limitations:
Does not find uniforms defined in interface blocks.
Does not handle '\' continuing some statement onto the next line.
Does not handle C-style comments in a perfectly correct way.
Works only on ASCII shader files.
*/
#... |
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/vdevice.h>
#include <arch/bcm283x/gpio.h>
#include <arch/bcm283x/spi.h>
#include <ili9486/ili9486.h>
static int LCD_DC = 24;
static int LCD_CS = 8;
static int LCD_RST = 25;
// Screen settings
#define LCD_SCREEN_WIDTH 480
#d... |
/* -*- c -*-
* Time-stamp: <2011-06-22 20:46:42 rsmith>
*
* stl2pov/stl2pov.c
* Copyright © 2004--2009,2011 <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. Re... |
// 0x0701B9F0 - 0x0701BAD0
static const Vtx rr_seg7_vertex_0701B9F0[] = {
{{{ 26, 154, 0}, 0, { 1672, 1328}, {0xa9, 0xcd, 0x97, 0xff}}},
{{{ 666, 154, 410}, 0, { 0, 990}, {0xa9, 0xcd, 0x97, 0xff}}},
{{{ 666, 154, -613}, 0, { 1672, -714}, {0xa9, 0xcd, 0x97, 0xff}}},
... |
//
// main.c
// c-only-program
//
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#define MAX_SOL_TO_PRINT 50
#define START_WITH_2_ALWAYS 2
#define MAX_BASE 64
int _base_w4; // not related to width but need to _w4 for future _wx
// (and avoid w2 versi... |
#include "first.h"
/* mod_authn_pam
*
* FUTURE POTENTIAL PERFORMANCE ENHANCEMENTS:
* - database response is not cached
* TODO: db response caching (for limited time) to reduce load on db
* (only cache successful logins to prevent cache bloat?)
* (or limit number of entries (size) of cache)
* (may... |
/*
* Written in 2013 by <NAME> <<EMAIL>>
*
* 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 warranty.
*
* You should have received a copy of the CC... |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Mupen64plus - dd_rom.c *
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
* Copyright (C) 2015 LuigiBlood *
* ... |
#include <stdio.h>
#include "vecmat.h"
#include "color.h"
#include "imagebuf.h"
#include "wobj.h"
void test_no01()
{
tcolor32 c;
timagebuf a = create_imagebuf(640, 480);
fill_with_zero_imagebuf(&a);
c.r=128; c.g=128; c.b=128; c.a=255;
fill_color_imagebuf(&a, c);
c.r=255; c.g=0; c.b=0;... |
// Robot Template app
//
// Framework for creating applications that control the Kobuki robot
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include "app_error.h"
#include "app_timer.h"
#include "nrf.h"
#include "nrf_delay.h"
#include "nrf_gpio.h"
#include "nrf_log.h"
#include "nrf_log... |
/**
* Names : <NAME> & <NAME>
* Date : 19-02-2021
* Purpose : This program generates a sine wave, adds random gaussian noise to it,
* and tabulates the error in the 3 methods of integration-
* midpoint rule, trapezoid rule, simpson's rule.
* Also compares with the romberg method.
* Inputs : M : The ... |
/*
* funplay.c - Cartridge handling, Fun Play cart.
*
* Written by
* <NAME> <<EMAIL>>
*
* This file is part of VICE, the Versatile Commodore Emulator.
* See README for copyright notice.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public L... |
/**************************************************************************
* Copyright (c) 2001 by Acunia N.V. All rights reserved. *
* *
* This software is copyrighted by and is the sole property of Acunia N.V. *
* and its licens... |
/*
* Copyright (c) 2021 Teslabs Engineering S.L.
* SPDX-License-Identifier: Apache-2.0
*/
#include <math.h>
#include <ztest.h>
#include <spinner/svm/svm.h>
/** Value of sqrt(3). */
#define SQRT_3 1.7320508075688773f
/** @brief Test that two floats are almost equal (works for small numbers). */
#define ALMOST_EQ... |
#include <netinet/in.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <arpa/inet.h>
#include <sys/random.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <sys/socket.h>
#include <netdb.h>
#include <sys/epoll.h>
#include <sys/wait.h>
#include <signal.h... |
#pragma once
#include <stdbool.h>
typedef enum cgKey
{
cgKeyUnknown = 0,
cgKeyA = 4, cgKeyB = 5, cgKeyC = 6,
cgKeyD = 7, cgKeyE = 8, cgKeyF = 9,
cgKeyG = 10, cgKeyH = 11, cgKeyI = 12, cgKeyJ = 13, cgKeyK = 14,
cgKeyL = 15, cgKeyM = 16, cgKeyN = 17, cgKeyO = 18, cgKeyP = 19,
cgKeyQ = 20, cgKeyR = 21, cgKeyS = 22,... |
#include "ui.h"
#include <ncurses.h>
#define MIN_STAT_DISPLAY 8
#define MIN_IP_SPACING 23
#define MIN_MAC_SPACING 20
#define MAX_MAC_SPACING_FACTOR 0.35
#define MIN_PROTOCOL_SPACING 10
#define MAX_PROTOCOL_SPACING_FACTOR 0.15
#define ETHER_TYPES_LINE 0
#define IP_TYPES_LINE 1
#define ARP_TYPES_LINE 2
#def... |
/*
* Copyright (c) 1991 <NAME>
*
* Disclaimer: No guarantees of performance accompany this software,
* nor is any responsibility assumed on the part of the authors. All the
* software has been tested extensively and every effort has been made to
* insure its reliability.
*/
/*
* pad - pad a sequence, inserti... |
#include "apg_maths.h"
#include "apg_ply.h"
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "../common/include/stb/stb_image_write.h"
#include <assert.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MIN( a, b ) ( ( a ) < ( b ) ? ( a ) : (... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "config.h"
#define CFG_LINE_LEN_MAX 510
#define INITIAL_CAPACITY 62 // 62 H5VL_provenance methods in total
/* Configuration parser */
void init_config(prov_config* params_out){
if(!params_out)
params_out = (prov_config*) calloc(1, size... |
/*
* Copyright (c) 2017 <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, copy, modify, merge, publish, distribut... |
/* Copyright 2020 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <atomic.h>
#include <device.h>
#include <drivers/espi.h>
#include <logging/log.h>
#include <kernel.h>
#include <stdint.h>
#include <zephyr... |
#include <klibc/string.h>
#include <klibc/malloc.h>
#include <klibc/ctype.h>
#include <klibc/errno.h>
#include <klibc/limits.h>
#undef memcpy
void* memcpy(void* destination, const void* source, size_t num)
{
void* temporaryDestination = destination;
asm volatile("rep movsl ; mov %3, %2 ; rep movsb" :... |
/****************************************************************************
* arch/arm/src/xmc4/xmc4_gpio.h
*
* 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 own... |
//EXact Cover
#include "exactcover.h"
//solution array
int solutions[MAX_ROW][MAX_COL];
int solend = 0;
int solcol = 0;
// Number of rows and columns in problem matrix
int nRow = 0,nCol = 0;
bool finished = false;
// Functions to get next index in any direction
// for given index (circular in nature)
int g... |
/* Dia -- an diagram creation/manipulation program
* Copyright (C) 1998 <NAME>
*
* 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 ... |
#include <stdio.h>
#include <readline/readline.h>
#include <fcntl.h>
#include <malloc.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <unistd.h>
struct buffer {
char *data;
size_t size;
size_t used;
size_t nlines;
};
static void buffer_appe... |
/**
* Stide - helper functions
*/
#include "helpers.h"
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include "../include/random.h"
#include "../include/sqlite3.h"
#include "stide.h"
/* http://stackoverflow.com/a/3208376/6049386 */
#define BYTE_TO_BINARY_PATTERN "... |
#include "nbfi.h"
#include "magma.h"
uint8_t inited;
static magma_ctx_t key_root_ctx;
static magma_ctx_t key_ul_master_ctx, key_ul_mic_ctx, key_ul_work_ctx;
static magma_ctx_t key_dl_master_ctx, key_dl_mic_ctx, key_dl_work_ctx;
static uint32_t NBFi_Crypto_MIC(magma_ctx_t *ctx, const uint8_t *buf, uint8_t len)
{
... |
#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 <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <math.h>
char number[3];
int eflg;
char w2006[100];
int flg = 0;
char realwd[100];
char *wd = &realwd[1];
char *fptr;
char ffbuf[36];
char *ffptr =... |
/* Copyright (c) 2014-2016, Marel
*
* 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 copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ... |
int getLabel(){
return label++;
}
int getReg(){
if(tempreg>19) {
printf("\nOut of registers\n");
exit(0);
}
else {
tempreg++;
return tempreg-1;
}
}
void saveReg(FILE *fp){
int i=0;
for(i=0;i<tempreg;i++){
fprintf(fp,"PUSH R%d\n",i);
}
tempCount=tempreg;
}
void restoreReg(FILE *fp){
//pop in reve... |
// Snake C program for LM-8 architecture
extern void write(unsigned int port, unsigned int value);
extern unsigned int read(unsigned int port);
extern void draw_sprite(unsigned int x, unsigned int y, char* sprite);
extern void draw_pixel(unsigned int x, unsigned int y, unsigned int color);
extern void print(char* stri... |
// SPDX-License-Identifier: BSD-2-Clause
/*
Copyright 2015 <NAME>
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 ... |
/*-
* Copyright (c) 2018 <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 and... |
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* o... |
/*
* Cache.c
*
* Created on: 2017-9-16
* Author: root
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "LRU_Cache.h"
#include "tec_cache.h"
static void freeList(LRUCacheS *cache);
/*****************************
* LRU缓存及缓存单元相关接口及实现
******************************/
/* 创建一个缓存单元 */
stat... |
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "macros.h"
#include "lval.h"
#include "lenv.h"
#include "builtins.h"
/* If we are compiling on Windows compile these functions */
#ifdef _WIN32
#include <string.h>
static char buffer[2048];
/* Fake readline function */
char* readline(char* prompt)
{
... |
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <float.h>
#include "CGL_CONVEXHULL.h"
#include "CGL_UTILS.h"
#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
void CGL_CONVEXHULL_FREE(CGL_Convexhull_t* hull) {
free(hull->points);
}
/*
* <NAME>, convex hull algorithm
* Time Complex... |
#include <ncurses.h>
#include <stdlib.h>
#include <string.h>
#include "gui.h"
#include "util.h"
#define KEY_ESC 27
#define DEFAULT_ROUND_TIME 59
/* playing_round has 3 state: */
/* 0 new game wait to start */
/* 1 game in progress */
/* -1 round ended cause time expired */
int n_ch = 0, playing_roun... |
// A pedagogical video player that will stream through every video frame as fast as it can
// // and play audio (out of sync).
// //
// //
// // Use
// //
// // gcc `pkg-config --cflags --libs libavutil libavformat libavcodec
// // libswscale` `sdl-config --cflags --libs` -o tutorial03 tutorial03.c
// // to build ... |
#include "xparameters.h"
#include "SPI_Master_IP.h"
#include "xil_io.h"
#include "xil_types.h"
#include "xtmrctr.h"
#include "xscugic.h"
#define INTC_DEVICE_ID XPAR_PS7_SCUGIC_0_DEVICE_ID
#define TIMER_DEVICE_ID XPAR_TMRCTR_0_DEVICE_ID
#define INTC_TMR_INTERRUPT_ID XPAR_FABRIC_AXI_TIMER_0_INTERRUPT_INTR
XTmrCt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.