text stringlengths 9 5.83M |
|---|
/***************************************************************************//**
@file FrontEnd.h
@brief
@author MAGT
******************************************************************************/
/*******************************************************************************
* INCLUDE HEADER FILES
... |
/*
* File: Com485Interface.h
* Author: fascio
*
* Created on December 12th, 2014, 16:02
*/
#ifndef __COM_485_INTERFACE_H__
#define __COM_485_INTERFACE_H__
//**********************************************************************
// Includes
//********************************************************************... |
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
main(int argc, char *argv[]) {
int pidh;
int fd[2];
char c;
char buf[128];
pipe(fd);
pidh=fork();
if (pidh == 0) {
dup2(fd[1], 1);
close(fd[1]); close(fd[0]);
execlp("./exam1", "exam1",argv[1],(char *) 0);
}
close(fd[1]);
pidh=fork();
i... |
/*********************************************************************************************************
**
** 中国软件开源组织
**
** 嵌入式实时操作系统
**
** SylixOS(TM) LW : long wing
**
** Copyright Al... |
#pragma once
// File: DoublesDRCPData.h
//////////////////////////////////////////////////////////////////////////
// Test data from here to the end.
//////////////////////////////////////////////////////////////////////////
#ifdef WGF11SHADER5X
CShader5xTest_DoubleArith::Binary64Vec2 const CShader5xTest_drcp::... |
/* Show pointer operations, example 2.
*/
#include <stdio.h>
int
main(int argc, char *argv[]) {
int n=123, *pi;
double x=456.789, *pd;
printf(" n = %3d, x = %7.3f\n", n, x);
pi = &n;
pd = &x;
printf("*pi = %3d, *pd = %7.3f\n", *pi, *pd);
*pi = *pi+1;
*pd = *pd / *pi;
printf("*pi = %3d, *pd = %7.3f\n", *pi... |
/* Copyright (c) [2019] juruoyun developer team
Juruoyun basic lib is licensed under the Mulan PSL v1.
You can use this software according to the terms and conditions of the Mulan PSL v1.
You may obtain a copy of Mulan PSL v1 at:
http://license.coscl.org.cn/MulanPSL
THIS SOFTWARE IS PROVIDED ON AN "AS... |
//inline char rgb_24_8(int color){return ((color>>6)&3)|((color>>11)&0x1C)|((color>>16)&0xE0); }
//inline short rgb_24_16(int color){return ((color>>3)&0x1f)|((color>>5)&0x7e0)|((color>>8)&0xf800); }
//inline char rgb_16_8(short color){return ((color>>3)&3)|((color>>6)&0x1C)|((color>>8)&0xE0); }
inline char BGR_... |
/*
** EPITECH PROJECT, 2018
** test_init_list2.c
** File description:
** test init_list part2
*/
#include <criterion/criterion.h>
#include "linked_list.h"
Test(pop, simple_test)
{
char *str[] = {"test0", "test1", "test3", "test4", 0x0};
linked_list_t list = {0};
void *data = 0x0;
for (int i = 0 ; st... |
#include <std.h>
#include <amun.h>
inherit ARMOUR;
void create() {
::create();
set_name("paw warmers");
set("id", ({ "gloves", "paw warmers", "paw", "warmers" }) );
set("short",
"%^RESET%^%^ORANGE%^P%^RESET%^a%^ORANGE%^w "
"%^RESET%^W%^ORANGE%^a%^RESET%^r%^ORANGE%^m"
"%^RESET%^e%^ORANG... |
#include<stdio.h>
#define SIZE_COLUMN 4
#define SIZE_ROW 4
void disp_mx(int matrix[SIZE_COLUMN][SIZE_ROW])
{
int i,j;
printf("The current matrix is : \n\n");
for (i=0;i<SIZE_ROW;i++)
{
for (j=0;j<SIZE_COLUMN;j++)
{
printf(" %d",matrix[i][j]);
}
printf("\n");
}
printf("\n");
}
|
/**
* @file irq.c
* @author TsMax (QinYUN575@Foxmail.com)
* @brief
* @version 0.1
* @date 2021-07-14
*
* @copyright Copyright (c) 2021
*
*/
#include <rtthread.h>
#include <rthw.h>
/**
* @addtogroup Kernel
*/
volatile rt_uint8_t rt_interrupt_nest;
/**
* @brief This function will ... |
/**
* \file
*
* \brief SAM UART
*
* Copyright (C) 2016-2018 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 are met:
*
* 1. Redistrib... |
#ifndef lint
static char *sccsid = "@(#)rindex_.c 1.2 (ULTRIX) 12/9/85";
#endif lint
/************************************************************************
* *
* Copyright (c) 1985 by *
* Digital Equipment Corporation, Maynard, MA *
* All rights reserved. *
* *
* This software is... |
typedef struct {
sp_ftbl *ft;
uint32_t index;
int record;
} sp_tblrec;
int sp_tblrec_create(sp_tblrec **p);
int sp_tblrec_destroy(sp_tblrec **p);
int sp_tblrec_init(sp_data *sp, sp_tblrec *p, sp_ftbl *ft);
int sp_tblrec_compute(sp_data *sp, sp_tblrec *p, SPFLOAT *in, SPFLOAT *trig, SPFLOAT *out);
|
/* ***************************************************************************
*
* COPYRIGHT: $Company: AVL Software and Functions GmbH $
* FILENAME: $Source: Spi.h $
* COMPILER: Tasking
* PROZESSOR: Tricore
*
* DATE OF CREATION: 19.05.2010
* LAST REVISION: $Da... |
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
int check_win();
void pf();
void check_box1(char skill);
void check_box2(char skill);
//prototyping functions
char game[3][3];
//making game a global variable of an array.
int main()
{
int i,col=3,j,ans,a;
char skill,skill2,k;
printf("\t\t......... |
/*
* @(#)ssreg.h 1.6 (ULTRIX) 1/29/87
*/
/************************************************************************
* *
* Copyright (c) 1984, 1986, 1987 by *
* Digital Equipment Corporation, Maynard, MA *
* All rights reserved. *
* *
* This software is furnished under a license and ... |
#include<stdio.h>
main()
{
long x,y,i,t,ans;
int m=0;
/*
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);*/
while(scanf("%ld%ld",&x,&y)!=EOF)
if(y%x!=0){ printf("0\n");continue;}
else
{
m=0;
t=y/x;
for(i=2;i<=t;i++)
{
if(t%i==0)
... |
#ifndef ZNPCGOALVILLAGER_H
#define ZNPCGOALVILLAGER_H
#endif |
#include<stdio.h>
main()
{
int a,b,ans=1 ; scanf("%d%d",&a,&b) ;
while(b--) ans*=a ;
printf("%d\n",ans) ;
}
|
/*
ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
2011,2012 Giovanni Di Sirio.
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 Foundatio... |
#include <stdio.h>
#define T 50
void imprimirVetor(float v[], int tam)
{
int j;
for (j = 0; j < tam; j++) {
printf("%.2f\n", v[j]);
}
printf("\n");
}
void dividirPeloMaior(float v[])
{
int j;
float maior = v[0];
/* encontrado o maior elemento ... |
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include "error.h"
#include "lexer.h"
static char yytext[1000];
static char c;
static int len = 0; //yytext len
static char * symTable[4096];
static Stat * statTable[4096];
void buildDFA()
{
FILE * f = fopen("dfa.txt", "r");
int n, m;
... |
#include "main.h"
void LED_Run(void)
{
TIM_SetCompare1(TIM4,OUTPUTDEVICE.LED[0]*10);
TIM_SetCompare2(TIM4,OUTPUTDEVICE.LED[1]*10);
TIM_SetCompare3(TIM4,OUTPUTDEVICE.LED[2]*10);
TIM_SetCompare4(TIM4,OUTPUTDEVICE.LED[3]*10);
TIM_SetCompare2(TIM3,OUTPUTDEVICE.LED[4]*10);
TIM_SetCompare1(TIM3,OUTPUTDEVICE.LED[5]... |
/*
*******************************************************************************
* @file crc16MB.c
* @author Hardware Team
* @modifier JWF
* @version v2.0.1
* @date 06-October-2015
* @status under development
* - unclean
* @brief CRC 16 (MODBUS) module
* This file provides firmware functions to m... |
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include "queue.h"
tQueue *queue_init()
{
tQueue *queue;
queue = malloc( sizeof (tQueue));
return queue;
}
bool queue_from_array(tQueue *queue, int arr[], int size)
{
int i;
for (i = 0; i < size; i++) {
queue_enqueue(queue, arr[i... |
#define MICROPY_HW_BOARD_NAME "Raspberry Pi Zero W"
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO3)
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO2)
#define MICROPY_HW_LED_STATUS (&pin_GPIO47)
#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO14)
#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO15)
|
#include <stdio.h>
int fatorial(int n);
int main()
{
int n = 0;
while (n <= 0)
{
printf("Digite um numero inteiro positivo: ");
scanf("%d", &n);
if (n <= 0)
printf("Invalido. O numero digitado deve ser um numero inteiro positivo.\n\n");
}
printf("O fatorial de %d eh %d.\n", n, fatorial(n... |
/*
* Copyright (C) 2018 ETH Zurich and University of Bologna
*
* 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... |
#pragma once
#include "../../common.h"
void vlc_init(Player p);
void vlc_destroy(void);
void vlc_in_received_handler(DictionaryIterator *iter);
void vlc_out_sent_handler(DictionaryIterator *sent);
void vlc_out_failed_handler(DictionaryIterator *failed, AppMessageResult reason);
|
/*
* lab2b.c
*
* Created on: Apr 6, 2014
* Author: Anh Huy
*/
#include "control.h"
int lab2b(void){
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
// BCSCTL1 = CALBC1_1MHZ; //cai dat clock noi la 1MHz
// DCOCTL = CALDCO_1MHZ;
P2DIR = 0xFF;
P2SEL = 0;
P2OUT = 0;
while(1)
... |
#pragma once
#include "cJSON.h"
char *reddit_get_random_image_url (const cJSON *);
static cJSON *reddit_get_image_object_list (const cJSON *);
|
/**
* Author : WANG FENG
* File : x.c
* Date : 2014年 7月11日 星期五 11时00分34秒 CST
* Desc :
* History : 1.created on 2014年 7月11日 星期五 11时00分34秒 CST by WANG FENG
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char** argv) {
int num,idx,i,j,add,k;
char a[1024], b[102... |
/* program based on foo.c to get t of contrast between 2 contitions
in cumulative position at each time slice */
void oops(char *x);
#include <stdio.h>
#include <stdlib.h>
#include <io.h>
#include <process.h>
#include <fcntl.h>
#include <sys\stat.h>
#include <ctype.h>
#include <math.h>
main()
{
char ... |
#include "stm32f4xx_gpio.h"
#include "my_button.h"
#include "my_spi.h"
#include "my_usart.h"
#include "my_menu.h"
#include "my_delay.h"
#include "my_led.h"
#include "interrupt_handle.h"
#include <stdio.h>
/**
* Handle user button interrupt
*/
void EXTI0_IRQHandler (void) {
if (EXTI_GetITStatus(EXTI_Line0) == SET... |
/** @file test_ascii_helpers.c
* @brief tests for ascii helpers functions
*
* @author turchenkov@gmail.com
* @bug
* @date 09-Mar-2019
*/
#include <string.h>
#include "testhelpers.h"
#include "test_ascii_helpers.h"
#include "ascii_helpers.h"
typedef struct test_case {
char *in_str;
bool resH... |
#include <types.h>
#include <subr.h>
#include <cpufunc.h>
#include <platform.h>
//uint64_t sys_cycle = 0;
//uint64_t jiffies = 0;
int irq_handler()
{
// sys_cycle++;
// kprintf("lp=0x%x\n",(uint32_t)sys_cycle);
if(arch_cntp_ctl_get()&BIT_2){
arch_cntp_tval_set(SYSTICK);
arch_cntp_ctl_set(1);
return 0;//systick... |
#include <std.h>
// for ROOM_VOID
#include <rooms.h>
#define COL "%^BOLD%^%^MAGENTA%^"
#define COL2 "%^YELLOW%^"
#define RES "%^RESET%^"
#define FAIL(s) return notify_fail(s+"\n")
#define PHANTASM_PROP_INFO "phantasm_spell_info"
inherit DAEMON;
string *get_spells(string sub);
int spell() {
object tp=this_playe... |
#include "storage.h"
#include <string.h>
uint8_t validate_signature(uint8_t* buffer) {
return (buffer[510] != 0x55 || buffer[511] != 0xAA);
}
fs_error find_partition(fs_storage_device* device, const uint8_t partition_number, uint32_t* sector) {
fs_error err = FS_SUCCESS;
err = read_buffered_sector(device, 0); //... |
/*
* s0.c
*
* Created on: 06.04.2017
* Author: seven
*/
#include "s0.h"
#include "esp/gpio.h"
#include <stdio.h>
#include <string.h>
#include "FreeRTOS.h"
#include "task.h"
typedef struct energyCounter_s
{
uint8_t id;
uint8_t gpio;
uint16_t pulseCount;
uint16_t lastPulseCount;
uint1... |
#ifndef FREERTOS_H
#define FREERTOS_H
#include "include/FreeRTOS.h"
#include "include/task.h"
#include "include/queue.h"
#include "include/semphr.h"
#include "cmsis_os.h"
#include "string.h"
#include "Prj_config.h"
void freertos_init(void);
#endif
|
#ifndef _PARSE_CONF_H
#define _PARSE_CONF_H
#define SITE_CHUNK 10
struct loong_site
{
char id[30];
char key[30];
char update_key[30];
//------要回调的url参数
char del[128];
char login[128];
char logout[128];
char update[128];
};
struct loong_config
{
size_t timeout;
u_sho... |
#include<stdio.h>
int main()
{
int x,y,r;
printf("두개의 정수 입력 : ");
scanf("%d%d", &x, &y);
printf("%d%d", &x, &y);
if(y>x)
{
temp=x;
x = y;
y = temp;
}
while(y != 0)
{
r = x % y;
x=y;
y=r;
}
printf("최대공약수는 %d입니다",x);
}
|
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "logoffset.h"
#define TH_NAME "off_lastupdate"
#define TM_SIZE 8
int get_thres(void);
int set_thres(time_t *th_new);
int main(int argc, char *argv[])
{
int ret = -1;
int opt = 1;
char *endp;
time_t th_new = -1;
while ((opt... |
/*
****************************************************************
* *
* dcl-level.c *
* *
* Process declarations and symbol lookup for C front end. *
* Also constructs types; the standard scalar types at *
* initialization, and structure, union, array and enum *
* types when they are declar... |
//
// Created by tairy on 2020/11/17.
//
#ifndef TJVMSRC_SLOT_H
#define TJVMSRC_SLOT_H
#include "stdlib.h"
union slot {
u_int32_t num;
void *ref;
};
void set_ref(union slot **vars, u_int32_t index, void *ref);
void *get_ref(union slot **vars, u_int32_t index);
void set_var(union slot **vars, u_int32_t ind... |
#include <stdio.h>
#include <stdlib.h>
/*
13) Scrivere un programma che, creata una lista di interi come nell'esercizio
precedente, calcoli e stampi la sua lunghezza percorrendo la lista dall'inizio
alla fine.
Ricordarsi di deallocare la lista prima di uscire dal main (e verificare con
valgrind che questo sia avvenuto... |
#ifndef lint
static char *sccsid = "@(#)markopen.c 1.1 (ULTRIX) 1/8/85";
#endif lint
/************************************************************************
* *
* Copyright (c) 1984 by *
* Digital Equipment Corporation, Maynard, MA *
* All rights reserved. *
* *
* This software is... |
#include <raylib.h>
#include <raymath.h>
#define SCREEN_WIDTH 800
#define SCREEN_HEIGHT 600
#define SPEED 4
int main(int argc, char *argv[]) {
InitWindow(SCREEN_WIDTH, SCREEN_HEIGHT, "Simple Third Person Camera");
Camera camera = {
{0.0f, 10.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, 45.0f, 0};
... |
/*
* main.c
*
* Created: 24/09/2013 7:21:16 AM
* Author: THIET KE 3
*/
#define F_CPU 16000000ul
#include <util/delay.h>
#include <stdlib.h>
#include <stdio.h>
#include <avr/io.h>
#include "lpd6803_pro.h"
#include "lpd6803.h"
Color_pack RGB[max_led];
int main(void)
{
lpd6803_config_pin();
set_base_color(RGB,_B... |
#ifndef __READ_SEQ_H__
#define __READ_SEQ_H__
#include <stdio.h>
char *read_sequence(FILE *fd, long max_len);
void load_one_seq(char *filename, char **seq);
void load_two_seq(char *filename, char **seq1, char **seq2);
#endif /* __READ_SEQ_H__ */
|
#include "lib/setConf.h"
// Genera il file httpd.conf recuperando l'attuale percorso dove verrà eseguito il config
char* setConf(char* path, char* port)
{
char write[200];
char *pwd;
if (getDir() == NULL)
perror("Errore nel recuperare il persorso attuale, file httpd.conf non generato correttamente");
pwd=getDir... |
#include <ether/ether.h>
bool is_token_identical(Token* a, Token* b) {
assert(a);
assert(b);
if (str_intern(a->lexeme) == str_intern(b->lexeme)) {
return true;
}
return false;
}
void token_error(bool* error_occured, uint* error_count,
Token* token, const char* fmt, ...) {
va_list ap;
va_start(ap, fmt);... |
#include <stdio.h>
void main()
{
int size = 5;
int a[5];
int i;
for(i=0; i<=5; i++){
scanf("%d", &a[i]);
}
printf("Here are your array elemnts");
for(i =0; i<=5; i++){
printf("your ", a[i])
}
} |
void fit_mjj_Full_PFDijetAug2016bgCSVv2le1b350()
{
//=========Macro generated from canvas: c/c
//========= (Fri Aug 10 13:29:36 2018) by ROOT version6.02/05
TCanvas *c = new TCanvas("c", "c",0,0,600,700);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
c->SetHighLightColor(2);
c->Range(0,0,1,1);
c->Se... |
#include <stdio.h>
#include <stdlib.h>
#define N 5 // Size of Stack
int top = -1; // Top Pointer
/*
* push(int s[],int x)
* --------------------------------------
* Pushes(Inserts) an element into Stack.
* Params:
* s[]: Stack Array.
* x: Element to be inserted.
*/
void push(int s[]... |
// author <pemakoa@gmail.com>
// Saturday, June 18, 2016 21:53:49 GMT+8
// 检查对 C11的支持
// 要使用 string.h 中的可选函数,必须在 string.h的 include 语句之前,在
// 源文件中定义 __STDC_WANT_LIB_EXT1__符号,来表示值1
/*
#include <stdio.h>
int main(void)
{
#if defined __STDC_LIB_EXT1__
printf("Opthional functions are defined.\n");
#else
printf("Opthion... |
/* query.c ---
*
*
* Author: Rachelle A. Louie
* Created: Thu Oct 29 15:52:44 2020 (-0400)
* Version:
*
* Description:
*
*/
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include "hash.h"
#include "queue.h"
#include "indexio.h"
int rank;
typedef struct wordCount... |
__attribute__((aligned(32))) const unsigned char HomeMenu_tex_button_wiiMenu_active[] = {
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xf... |
#include "psc.h"
#include "psc_particles_acc.h"
#include "psc_acc.h"
// for conversions
#include "psc_particles_single.h"
#include <stdlib.h>
// ======================================================================
// psc_particles "acc"
// ----------------------------------------------------------------------
//... |
#include "ModuleManager.h"
#include "LeapUtility.h"
#include "FLeapMotionPlugin.h"
#include "Core.h"
#include "Engine.h" |
#ifndef INTERPRETER_H
#define INTERPRETER_H
int interpreter(char *raw_input);
#endif |
//#############################################################################
// FILE: usbcdesc.c
// TITLE: Config descriptor parsing functions
//#############################################################################
// $TI Release: F2837xD Support Library v190 $
// $Release Date: Mon Feb 1 16:51:57 CST 2016 ... |
/******************************************************************************
Algoritmo para converter um número Decimal digitado pelo usuário para
Binário e Octal.
*******************************************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
// Structs p... |
# include <stdio.h>
int main(){
int x = -2;
printf("%d\n",x>-3>0);
printf("%d\n",0<1<0);
return 0;
}
|
#include <std.h>
#include <zexor.h>
inherit ARMOUR;
create() {
::create();
set_name("armour");
set_short("%^GREEN%^Bra%^BOLD%^%^WHITE%^m%^RESET%^%^GREEN%^bl%^BOLD%^%^WHITE%^e an%^RESET%^%^GREEN%^d T%^BOLD%^%^WHITE%^h%^RESET%^%^GREEN%^o%^BOLD%^%^WHITE%^rn%^RESET%^ armour");
set_long("This is a full body arm... |
*/
/* classes used for instanciation
/* classes used for invoke
*/
#ifndef _OZ0001000002000238P_H_
#define _OZ0001000002000238P_H_
static OZ_ExceptionIDRec OZ_0001000002000238_IllegalInvoke = {0x0001000002000238LL, 0};
static OZ_ExceptionIDRec OZ_0001000002000238_Unbalanced = {0x0001000002000238LL, 1};
static OZ_Exc... |
void updateCameraPosition(float timePassed) {
static const glm::vec3 up(0.0f, 1.0f, 0.0f);
float progress = gameSpeed * timePassed;
if (boostActive)
progress *= boostFactor;
levelProgress += progress;
glm::vec3 pos = Engine::cameraPath->getInterpolatedPoint(levelProgress);
glm::vec3 lookAt = Engine::cameraP... |
/*++
Copyright (c) Microsoft Corporation. All rights reserved.
Module Name:
busif.c
Abstract:
bus interface for the usbport driver
this is where we export the routines that create
and remove devices on the bus for use by the hub
driver.
Environment:
kernel mode only
... |
#include <std.h>
#include <illuminati.h>
inherit PACK;
mapping spheres;
void create() {
::create();
set_id( ({ "belt", "star belt" }) );
set_name("star belt");
set_short("%^RESET%^BLUE%^S%^BOLD%^ta%^YELLOW%^r B%^BLUE%^el%^RESET%^BLUE%^t%^RESET%^");
set_long("The Star Belt is made from a soft,... |
/**
* recover.c
*
* Computer Science 50
* Problem Set 4
*
* Recovers JPEGs from a forensic image.
*/
#include <stdio.h>
#include <stdint.h>
#include <cs50.h>
typedef uint8_t BYTE;
bool jpgcheck(BYTE buffer[]);
int main(void)
{
// Store card.raw
char* jpgfile = "card.raw";
// open input file... |
#include <string.h>
#include <malloc.h>
#include "types.h"
#include "result.h"
#include "services/applet.h"
#include "applets/libapplet.h"
#include "applets/web.h"
#include "runtime/hosversion.h"
static Result _webLaunch(AppletHolder* holder, AppletId id, u32 version, void* arg, size_t arg_size) {
Result rc=0;
... |
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "socket_wrapper.h"
int create_socket(int domaine, int type, int protocole, const char* error_msg){
int socket_fd = socket(domaine, type, protocole);
if(socket_fd == -1){
perror(error_msg);
exit(EXIT_FAILURE);
}
// printf("socket create... |
#include "types.h"
#include "param.h"
#include "user.h"
int main(int argc, char *argv[])
{
if(argc != 2)
{
printf(1,"Needs 1 arguments!\n");
exit();
}
int ratio = atoi(argv[1]);
set_tickets(getpid(), ratio);
printf(1, "expected ratio: %d:1.\n", ratio);
int forkretv =... |
/*
* Sample code demonstrating how to use the file monitor.
*/
#include <errno.h>
#include <poll.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include "monitor.h"
#include "fileevent.h"
void show_all(monitor *m) {
FileInfo_FS *file = monitor_get_current_files(m);
while (file != NULL) {
Fil... |
//
// Created by indrek on 27.11.2016.
//
#ifndef ROBOTEXLINEFOLLOWERMAIN_LINESEGMENT_H
#define ROBOTEXLINEFOLLOWERMAIN_LINESEGMENT_H
#include "Arduino.h"
struct LineSegment {
int16_t range;
int16_t x1;
int16_t y1;
int16_t x2;
int16_t y2;
bool isEndOfLine;
LineSegment(
int16_t... |
#include <stdio.h>
typedef struct {
int length;
int width;
} rectangle;
int comparerectangle(rectangle* r1, rectangle* r2) {
int r1Area = r1->length * r1->width;
int r2Area = r2->length * r2->width;
if (r1Area == r2Area) {
return 0;
}
return r1Area < r2Area ? -1 : 1;
}
int main (... |
#include"../inc/epoll_inc.h"
#include<unistd.h>
#include<stdio.h>
#define BUFSIZE 1024
/*main start*/
int main(int argc,char **argv){
fd_set readset;
fd_set temps;
int result,str_len;
char buf[BUFSIZE];
struct timeval tmval;
FD_ZERO(&readset);
FD_SET(STDIN_FILENO,&readset);//
while(... |
#ifndef _TINYLIBC_CONFIG_H
#define _TINYLIBC_CONFIG_H
#if defined(TLIBC_STATIC)
#define TLIBC_FN static inline
#else
#define TLIBC_FN
#endif
#endif /* _TINYLIBC_CONFIG_H */
#define _TINYLIBC_IN_USE
|
/**
* This file is part of the Zephir.
*
* (c) Phalcon Team <team@zephir-lang.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code. If you did not receive
* a copy of the license it is available through the world-wide-web at the
* fol... |
/*
print_pdb / print_pe - Copyright 2005-2023 by Michael Kohn
Webpage: https://www.mikekohn.net/
Email: mike@mikekohn.net
This code falls under the LGPL license.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include "fileio.h"
#include "pdb.h"
int main(int argc, char *argv[... |
#define CREATE_TRACE_POINTS
#include <trace/events/six.h>
|
#include "../includes/ft_printf.h"
void exit_func()
{
system("leaks ft_printf");
exit(1);
}
// #define ARG "Result|||||||||%#50.22x*\n", 157
int main(void)
{
int my_result;
int org_result;
// int a = 0;
// int *b = &a;
// long long double chlen = -0;
... |
#include<stdio.h>
#define max 100
#define BLACK 2
#define WHITE 0
#define GRAY 1
//変数
struct Graph{
int u,k;
}graph[max];
int num,result[max][max],color[max],find[max],found[max],cnt_found;
int g[max][max];
//関数
void dfs();
void visit(int);
int main(){
int i,j;
scanf("%d",&num);
for(i=0;i<num;i++){
for(j... |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
int main()
{
int count, i=1;
int a;
int col=0;
for(i=1;i<300000;i++)
{
count=0;
a=1;
while(a<=i)
{
if(i%a==0)
count++;
a++;
}
if (count==2)
{
col++;
}
}
return(0);
}
|
/*
* Log.hpp
*
* Created on: 2012-6-20
* Author: yaomaobiao
*/
#ifndef _HAL_SYS_LOG_H_
#define _HAL_SYS_LOG_H_
#ifdef __cplusplus
extern "C" {
#endif
void hal_sys_error(const char* pMessage, ...);
void hal_sys_warn(const char* pMessage, ...);
void hal_sys_info(const char* pMessage, ...);
void hal_sys_debug... |
/*
print_pe - Copyright 2005-2023 by Michael Kohn
Webpage: https://www.mikekohn.net/
Email: mike@mikekohn.net
This code falls under the LGPL license.
*/
#ifndef CLSID_H
#define CLSID_H
#include <stdint.h>
int clsid_read(char *clsid, FILE *in);
int clsid_print(const uint8_t *clsid);
#endif
|
#include <stdio.h>
#include <wiringPi.h>
#define PIR 1 // wPi 1 ,BCM_GPIO 18
int main (void) {
if (wiringPiSetup () == -1)
return 1 ;
pinMode (PIR, INPUT) ;
while(1) {
if (digitalRead(PIR) == LOW) {
printf("detected \n");
} else {
... |
/*
* =====================================================================================
*
* Filename: network_adapter.h
*
* Description: Head file of NuAgent core
*
* Version: 0.0.1
* Created: 2015/6/26 14:12:55
* Revision: none
*
* Author: Lin Hui (Link), linhui... |
/*
* Copyright 2017 National University of Singapore
*
* This program is for testing memory bounds check interpolation: It
* should discover an error because some memory bounds are not
* satisfied in subsumption check.
*
* The error report should disappear with the use of the option
* -special-function-bound-i... |
#ifndef __NL6621_DRV_H__
#define __NL6621_DRV_H__
typedef struct {
unsigned int boot_addr;
unsigned short boot_flag;
unsigned short boot_status;
unsigned int fw1_times;
unsigned int fw2_times;
}__attribute__((packed))BOOT_PARAM;
VOID ReadFlash(UINT8* pBuf, UINT32 DataLen, UINT32 ReadStartPos);
VOID Wri... |
// Test Simon RoCC
#include <stdint.h>
#ifndef BAREMETAL
#include <stdio.h>
#endif
#include "rocc.h"
#include "rvutil.h"
#include "simon/rocc.h"
#define SIMON_64_128_ROUNDS 44
// A 128-bit key
const static uint8_t test_key[16] = {0x80, 0x01, 0x02, 0xFF, 0x2A, 0xAA,
0x42, 0x00, 0x1... |
//C program to input datatypes and display their sizes.
#include<stdio.h>
int main()
{
/* int a;
char b;
float c;
long d;
double e;
printf("\nEnter character: ");
scanf("%c", &b);
printf("\nEnter integer: ");
scanf("%d", &a);
printf("\nEnter decimal: ");
scanf("%f", &c);
printf("\nEnter lon... |
#include <ether/ether.h>
static void parser_destroy(Parser*);
static Stmt* parse_decl(Parser*);
static Stmt* parse_stmt(Parser*);
static Stmt* parse_struct(Parser*, Token*);
static Stmt* parse_func(Parser*, bool);
static error_code parse_func_header(Parser*, Stmt*, bool);
static Stmt* parse_func_decl(Parser*);
static... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <semaphore.h>
#include <unistd.h>
#define wait_chairs 3
void *student(void *stud_id);
void *assistant();
sem_t s_stud;
sem_t s_Tass;
pthread_mutex_t mutex... |
#include "cos_config.h"
char* TEST_COS_ENDPOINT = "";
char* TEST_ACCESS_KEY_ID = "";
char* TEST_ACCESS_KEY_SECRET = "";
char* TEST_BUCKET_NAME = "";
|
//#############################################################################
// FILE: usbhhid.c
// TITLE: This file contains the host HID driver
//#############################################################################
// $TI Release: F2837xD Support Library v190 $
// $Release Date: Mon Feb 1 16:51:57 CST 201... |
/***************************************************************************//**
@file Button.h
@brief Simple driver for buttons
@author MAGT
******************************************************************************/
/*******************************************************************************
* ... |
#include "min_unit.h"
#include "pqueue.h"
#include "tests_pqueue.h"
#include <stdlib.h>
#include <stdio.h>
#ifdef _WIN32
#include <process.h>
#endif
char* test_pqueue_alloc() {
PriorityQueue* q = pqueue_alloc();
mu_assert(q != NULL);
pqueue_free(&q);
return 0;
}
char* test_pqueue_free() {
PriorityQueue* q = p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.