doc_id stringlengths 36 36 | metadata dict | input stringlengths 28 4.3k | output stringlengths 11 5.45k |
|---|---|---|---|
68bcd6fa-5645-493b-a6a2-8c81581b384d | {
"language": "C"
} | ```c
//
// RNSketchManager.m
// RNSketch
//
// Created by Jeremy Grancher on 28/04/2016.
// Copyright © 2016 Jeremy Grancher. All rights reserved.
//
#import "RCTViewManager.h"
#import "RNSketch.h"
@interface RNSketchManager : RCTViewManager
@property (strong) RNSketch *sketchView;
@end;
```
Support RN 0.40 he... | ```c
//
// RNSketchManager.m
// RNSketch
//
// Created by Jeremy Grancher on 28/04/2016.
// Copyright © 2016 Jeremy Grancher. All rights reserved.
//
#if __has_include(<React/RCTViewManager.h>)
// React Native >= 0.40
#import <React/RCTViewManager.h>
#else
// React Native <= 0.39
#import "RCTViewManager.h"
#endif
... |
7b56918f-371a-4418-a21a-368ab4aca70b | {
"language": "C"
} | ```c
// Copyright (c) 2014 Rob Rix. All rights reserved.
#import <Foundation/Foundation.h>
@protocol REDIterable <NSObject>
@property (readonly) id(^red_iterator)(void);
@end
```
Add a typedef for iterators. | ```c
// Copyright (c) 2014 Rob Rix. All rights reserved.
#import <Foundation/Foundation.h>
/// A nullary block iterating the elements of a collection over successive calls.
///
/// \return The next object in the collection, or nil if it has iterated the entire collection.
typedef id (^REDIteratingBlock)(void);
/// ... |
4c221a9e-bae5-49bf-9aa6-143b60e15d54 | {
"language": "C"
} | ```c
// RUN: %check %s
#pragma STDC FENV_ACCESS on
_Pragma("STDC FENV_ACCESS on"); // CHECK: warning: unhandled STDC pragma
// CHECK: ^warning: extra ';' at global scope
#define LISTING(x) PRAGMA(listing on #x)
#define PRAGMA(x) _Pragma(#x)
LISTING(../listing) // CHECK: warning: unknown pragma 'listing on "../listi... | ```c
// RUN: %check %s
#pragma STDC FENV_ACCESS ON
_Pragma("STDC FENV_ACCESS ON"); // CHECK: warning: unhandled STDC pragma
// CHECK: ^warning: extra ';' at global scope
#define LISTING(x) PRAGMA(listing on #x)
#define PRAGMA(x) _Pragma(#x)
LISTING(../listing) // CHECK: warning: unknown pragma 'listing on "../listi... |
abb70fb2-0522-4940-91cc-80980dfc5d06 | {
"language": "C"
} | ```c
#import "RCTBridgeModule.h"
@interface KCKeepAwake : NSObject <RCTBridgeModule>
@end
```
Correct import path to match RN 0.40 | ```c
#import <React/RCTBridgeModule.h>
@interface KCKeepAwake : NSObject <RCTBridgeModule>
@end
``` |
95208533-61e2-4521-b9c4-c0a6629a305d | {
"language": "C"
} | ```c
#include "kremlib.h"
#include "kremstr.h"
/******************************************************************************/
/* Implementation of FStar.String and FStar.HyperIO */
/******************************************************************************/
/* FStar.h is generally kept... | ```c
#include "kremlib.h"
#include "kremstr.h"
/******************************************************************************/
/* Implementation of FStar.String and FStar.HyperIO */
/******************************************************************************/
/* FStar.h is generally kept... |
76f76efc-7378-4fe9-8e14-6e3a09a9a883 | {
"language": "C"
} | ```c
/*
* A solution to Exercise 1-12 in The C Programming Language (Second Edition).
*
* This file was written by Damien Dart <damiendart@pobox.com>. This is free
* and unencumbered software released into the public domain. For more
* information, please refer to the accompanying "UNLICENCE" file.
*/
#include <... | ```c
/*
* A solution to Exercise 1-12 in The C Programming Language (Second Edition).
*
* This file was written by Damien Dart <damiendart@pobox.com>. This is free
* and unencumbered software released into the public domain. For more
* information, please refer to the accompanying "UNLICENCE" file.
*/
#include <... |
1d0c0713-89de-4b24-80d2-13518eb9d909 | {
"language": "C"
} | ```c
/*-------------------------------------------------------------------------
*
* pgtz.c
* Timezone Library Integration Functions
*
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.5 2004/05/01 01:38:53 momjian Exp $
... | ```c
/*-------------------------------------------------------------------------
*
* pgtz.c
* Timezone Library Integration Functions
*
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.6 2004/05/01 22:07:03 momjian Exp $
... |
2e2105f2-c5bd-4718-ab5d-a8dfa3069874 | {
"language": "C"
} | ```c
// RUN: %clang -target aarch64-linux-gnuabi %s -O3 -S -emit-llvm -o - | FileCheck %s
#include <complex.h>
complex long double a, b, c, d;
void test_fp128_compound_assign(void) {
// CHECK: tail call { fp128, fp128 } @__multc3
a *= b;
// CHECK: tail call { fp128, fp128 } @__divtc3
c /= d;
}
```
Remove incl... | ```c
// RUN: %clang -target aarch64-linux-gnuabi %s -O3 -S -emit-llvm -o - | FileCheck %s
_Complex long double a, b, c, d;
void test_fp128_compound_assign(void) {
// CHECK: tail call { fp128, fp128 } @__multc3
a *= b;
// CHECK: tail call { fp128, fp128 } @__divtc3
c /= d;
}
``` |
de358c5c-ef67-4491-8c8d-cbbe21a0e53a | {
"language": "C"
} | ```c
/**
* Copyright (C) 2006-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* 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.... | ```c
/**
* Copyright (C) 2006-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* 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.... |
47624b1c-143f-49b5-b02f-f1cd72cebcf0 | {
"language": "C"
} | ```c
#ifndef CELL_H
#define CELL_H
#include <map>
#include <vector>
#include "number.h"
class Cell {
public:
Cell();
explicit Cell(const Cell &rhs);
explicit Cell(Cell *value);
explicit Cell(bool value);
explicit Cell(Number value);
explicit Cell(const std::string &value);
explicit Cell(c... | ```c
#ifndef CELL_H
#define CELL_H
#include <map>
#include <vector>
#include "number.h"
class Cell {
public:
Cell();
Cell(const Cell &rhs);
explicit Cell(Cell *value);
explicit Cell(bool value);
explicit Cell(Number value);
explicit Cell(const std::string &value);
explicit Cell(const char... |
a63185c0-be53-47fa-8d4e-09f9d4b7753e | {
"language": "C"
} | ```c
#ifndef QUAZIP_TEST_QUAZIP_H
#define QUAZIP_TEST_QUAZIP_H
#include <QObject>
class TestQuaZip: public QObject {
Q_OBJECT
private slots:
void getFileList_data();
void getFileList();
void getZip();
};
#endif // QUAZIP_TEST_QUAZIP_H
```
Remove getZip() which got there by mistake | ```c
#ifndef QUAZIP_TEST_QUAZIP_H
#define QUAZIP_TEST_QUAZIP_H
#include <QObject>
class TestQuaZip: public QObject {
Q_OBJECT
private slots:
void getFileList_data();
void getFileList();
};
#endif // QUAZIP_TEST_QUAZIP_H
``` |
039afe18-a197-4b0d-af90-e60166316f72 | {
"language": "C"
} | ```c
#ifndef _FAKE_LOCK_SCREEN_PATTERN_H_
#define _FAKE_LOCK_SCREEN_PATTERN_H_
#include <gtk/gtk.h>
#if !GTK_CHECK_VERSION(3, 0, 0)
typedef struct {
gdouble red;
gdouble green;
gdouble blue;
gdouble alpha;
} GdkRGBA;
#endif
typedef struct _FakeLockOption {
void *module;
gchar *real;
gchar *dummy;
} Fak... | ```c
#ifndef _FAKE_LOCK_SCREEN_PATTERN_H_
#define _FAKE_LOCK_SCREEN_PATTERN_H_
#include <gtk/gtk.h>
#if !GTK_CHECK_VERSION(3, 0, 0)
typedef struct {
gdouble red;
gdouble green;
gdouble blue;
gdouble alpha;
} GdkRGBA;
#endif
typedef struct _FakeLockOption {
void *module;
gchar *real;
gchar *dummy;
} Fak... |
73610582-9fd5-409f-910b-7d85e77960a2 | {
"language": "C"
} | ```c
```
Add file to handle executing commands from stdin | ```c
#ifndef _WISH_COMMANDER
#define _WISH_COMMANDER
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/wait.h>
char *exit_color;
int execute(char *path, char *arg_arr[]) {
int pid;
if (!(pid = fork())) {
execvp(path, arg_arr);
// T... |
02d3bced-f49a-437b-8b21-ae556370e973 | {
"language": "C"
} | ```c
/* Copyright 2021 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.
*/
#if !defined(__CROS_EC_HOST_COMMAND_H) || \
defined(__CROS_EC_ZEPHYR_HOST_COMMAND_H)
#error "This file must only be included from host_comman... | ```c
/* Copyright 2021 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.
*/
#if !defined(__CROS_EC_HOST_COMMAND_H) || \
defined(__CROS_EC_ZEPHYR_HOST_COMMAND_H)
#error "This file must only be included from host_comman... |
a9bf7153-ac7f-4f00-9eb6-e46d5119e9cf | {
"language": "C"
} | ```c
#import <Foundation/Foundation.h>
#import "Nocilla.h"
#import "LSHTTPRequest.h"
@class LSStubRequest;
@class LSStubResponse;
extern NSString * const LSUnexpectedRequest;
@interface LSNocilla : NSObject
+ (LSNocilla *)sharedInstance;
@property (nonatomic, strong, readonly) NSArray *stubbedRequests;
- (void)star... | ```c
#import <Foundation/Foundation.h>
#import "Nocilla.h"
@class LSStubRequest;
@class LSStubResponse;
@protocol LSHTTPRequest;
extern NSString * const LSUnexpectedRequest;
@interface LSNocilla : NSObject
+ (LSNocilla *)sharedInstance;
@property (nonatomic, strong, readonly) NSArray *stubbedRequests;
- (void)start... |
9a12b165-2ea6-4873-ba8f-c719e5d2140c | {
"language": "C"
} | ```c
```
Add array implementation of queue | ```c
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
/* This is Queue Implementation using Array */
#define MAXSIZE 101
#define BOOL_PRINT(bool_expr) "%s\n", (bool_expr) ? "true" : "false"
int A[MAXSIZE];
int front_q = -1;
int end_q = -1;
void enq(int data){
if(isEmpty()){
A[++end_q]=data;
front_q ... |
44a36d38-948b-420a-94e4-73de7621630f | {
"language": "C"
} | ```c
```
Add header with structs representing basic display types | ```c
/* Copyright (c) 2013 Adam Dej
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, distribu... |
af45f12a-507a-4a5b-b889-496e9ce1e553 | {
"language": "C"
} | ```c
// RUN: %clang_profgen -o %t -O3 -flto %s
// RUN: env LLVM_PROFILE_FILE=%t.profraw %t
// RUN: llvm-profdata merge -o %t.profdata %t.profraw
// RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s
int main(int argc, const char *argv[]) {
// CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !pr... | ```c
// RUN: %clang_profgen -o %t -O3 %s
// RUN: env LLVM_PROFILE_FILE=%t.profraw %t
// RUN: llvm-profdata merge -o %t.profdata %t.profraw
// RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s
int main(int argc, const char *argv[]) {
// CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof !1
... |
01aa2258-ec49-4cc8-8584-3bd57b1babbe | {
"language": "C"
} | ```c
//
// SAMCategories.h
// SAMCategories
//
// Created by Sam Soffes on 7/17/13.
// Copyright 2013 Sam Soffes. All rights reserved.
//
// Foundation
#import "NSArray+SAMAdditions.h"
#import "NSData+SAMAdditions.h"
#import "NSDate+SAMAdditions.h"
#import "NSDictionary+SAMAdditions.h"
#import "NSNumber+SAMAdditio... | ```c
//
// SAMCategories.h
// SAMCategories
//
// Created by Sam Soffes on 7/17/13.
// Copyright 2013 Sam Soffes. All rights reserved.
//
// Foundation
#import "NSArray+SAMAdditions.h"
#import "NSData+SAMAdditions.h"
#import "NSDate+SAMAdditions.h"
#import "NSDictionary+SAMAdditions.h"
#import "NSNumber+SAMAdditio... |
9685bdbc-aaaa-41fa-a72e-2f2e07f88141 | {
"language": "C"
} | ```c
//
// SwiftDevHints.h
// SwiftDevHints
//
// Created by ZHOU DENGFENG on 15/7/17.
// Copyright © 2017 ZHOU DENGFENG DEREK. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <CommonCrypto/CommonCrypto.h>
//! Project version number for SwiftDevHints.
FOUNDATION_EXPORT double SwiftDevHintsVersionNumber;
... | ```c
//
// SwiftDevHints.h
// SwiftDevHints
//
// Created by ZHOU DENGFENG on 15/7/17.
// Copyright © 2017 ZHOU DENGFENG DEREK. All rights reserved.
//
@import Foundation;
#import <CommonCrypto/CommonCrypto.h>
//! Project version number for SwiftDevHints.
FOUNDATION_EXPORT double SwiftDevHintsVersionNumber;
//!... |
203273c7-c04d-4301-b6cf-4451c48628bd | {
"language": "C"
} | ```c
#include "src/math/reinterpret.h"
#include <assert.h>
long double __addtf3(long double, long double);
static _Bool equivalent(long double x, long double y)
{
if (x != x)
return y != y;
return reinterpret(unsigned __int128, x) == reinterpret(unsigned __int128, y);
}
static _Bool run(long double ... | ```c
#include "src/math/reinterpret.h"
#include <math.h>
#include <assert.h>
long double __addtf3(long double, long double);
static _Bool run(long double x, long double y)
{
return reinterpret(unsigned __int128, x + y) == reinterpret(unsigned __int128, __addtf3(x, y));
}
int main(void)
{
assert(isnan(__addtf... |
ba00d845-deaa-4cb9-8c45-5dc8d20cd436 | {
"language": "C"
} | ```c
#ifndef __CLAR_TEST_ATTR_EXPECT__
#define __CLAR_TEST_ATTR_EXPECT__
enum attr_expect_t {
EXPECT_FALSE,
EXPECT_TRUE,
EXPECT_UNDEFINED,
EXPECT_STRING
};
struct attr_expected {
const char *path;
const char *attr;
enum attr_expect_t expected;
const char *expected_str;
};
static inline void attr_check_expect... | ```c
#ifndef __CLAR_TEST_ATTR_EXPECT__
#define __CLAR_TEST_ATTR_EXPECT__
enum attr_expect_t {
EXPECT_FALSE,
EXPECT_TRUE,
EXPECT_UNDEFINED,
EXPECT_STRING
};
struct attr_expected {
const char *path;
const char *attr;
enum attr_expect_t expected;
const char *expected_str;
};
GIT_INLINE(void) attr_check_expected... |
5fefcbe2-6d3e-48f2-8897-1cf9da366990 | {
"language": "C"
} | ```c
/*
* Copyright (C) 2011 by Nelson Elhage
*
* 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, merg... | ```c
/*
* Copyright (C) 2011 by Nelson Elhage
*
* 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, merg... |
bab6dc23-7d70-4fca-81f2-3445488adb7b | {
"language": "C"
} | ```c
//
// EditPatientForm.h
// OpenMRS-iOS
//
// Created by Yousef Hamza on 7/5/15.
// Copyright (c) 2015 Erway Software. All rights reserved.
//
#import "XLForm.h"
#import "XLFormViewController.h"
#import "MRSPatient.h"
@interface EditPatientForm : XLFormViewController <UIAlertViewDelegate>
- (instancetype)ini... | ```c
//
// EditPatientForm.h
// OpenMRS-iOS
//
// Created by Yousef Hamza on 7/5/15.
// Copyright (c) 2015 Erway Software. All rights reserved.
//
#import "XLForm.h"
#import "XLFormViewController.h"
#import "MRSPatient.h"
@interface EditPatientForm : XLFormViewController <UIAlertViewDelegate>
@property (nonatomi... |
f1ac64ae-277d-40ab-8995-87749f1e73a0 | {
"language": "C"
} | ```c
/* $OpenBSD: setjmp.h,v 1.6 2001/08/12 12:03:02 heko Exp $ */
/*
* machine/setjmp.h: machine dependent setjmp-related information.
*/
#ifndef __MACHINE_SETJMP_H__
#define __MACHINE_SETJMP_H__
#define _JBLEN 22 /* size, in longs, of a jmp_buf */
#endif /* __MACHINE_SETJMP_H__ */
```
Fix the *longjmp() behaviou... | ```c
/* $OpenBSD: setjmp.h,v 1.7 2003/08/01 07:41:33 miod Exp $ */
/*
* machine/setjmp.h: machine dependent setjmp-related information.
*/
#ifndef __MACHINE_SETJMP_H__
#define __MACHINE_SETJMP_H__
#define _JBLEN 21 /* size, in longs, of a jmp_buf */
#endif /* __MACHINE_SETJMP_H__ */
``` |
3dd8489b-42f8-4988-877f-254a044856b7 | {
"language": "C"
} | ```c
```
Add the vpsc library for IPSEPCOLA features | ```c
/**
* \brief A block structure defined over the variables
*
* A block structure defined over the variables such that each block contains
* 1 or more variables, with the invariant that all constraints inside a block
* are satisfied by keeping the variables fixed relative to one another
*
* Authors:
* Tim ... |
626a3cd3-4a5e-4d06-9448-a2ec1662e3ac | {
"language": "C"
} | ```c
//===-- lldb-python.h --------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------... | ```c
//===-- lldb-python.h --------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------... |
fec64e6c-4fc1-4f59-ac0a-48b46c490f78 | {
"language": "C"
} | ```c
#include <pal.h>
/**
*
* Converts integer values in 'a' to floating point values.
*
* @param a Pointer to input vector
*
* @param c Pointer to output vector
*
* @param n Size of 'a' and 'c' vector.
*
* @param p Number of processor to use (task parallelism)
*
* @param team Team to work... | ```c
#include <pal.h>
/**
*
* Converts integer values in 'a' to floating point values.
*
* @param a Pointer to input vector
*
* @param c Pointer to output vector
*
* @param n Size of 'a' and 'c' vector.
*
* @param p Number of processor to use (task parallelism)
*
* @param team Team to work... |
ac11a444-6a1b-4ad4-b90a-782a300c75f0 | {
"language": "C"
} | ```c
/*
Lunatic Python
--------------
Copyright (c) 2002-2005 Gustavo Niemeyer <gustavo@niemeyer.net>
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 Licen... | ```c
/*
Lunatic Python
--------------
Copyright (c) 2002-2005 Gustavo Niemeyer <gustavo@niemeyer.net>
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 Licen... |
cc7685b2-fdc5-4fd8-bc11-37ccafd6c251 | {
"language": "C"
} | ```c
#ifdef __CINT__
#pragma link off all glols;
#pragma link off all classes;
#pragma link off all functions;
#endif
```
Move AliD0toKpi* and AliBtoJPSI* from libPWG3base to libPWG3 (Andrea) | ```c
#ifdef __CINT__
#pragma link off all glols;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class AliD0toKpi+;
#pragma link C++ class AliD0toKpiAnalysis+;
#pragma link C++ class AliBtoJPSItoEle+;
#pragma link C++ class AliBtoJPSItoEleAnalysis+;
#endif
``` |
285b176c-dfee-4462-9496-94c1e53d0db4 | {
"language": "C"
} | ```c
#include <stdio.h>
unsigned int x;
char in;
void input(void);
void main(void){
x = 0;
input();
}
void input(void){
printf(">> "); /* Bash-like input */
scanf("%c", &in); /* Get char input */
/* Boundary checks */
if(x == 256 || x == -1) x = 0;
/* Operators */
switch(in){
case 'i': case ... | ```c
#include <stdio.h>
unsigned int x;
char in;
void input(void);
void run(char c);
void main(void){
x = 0;
input();
}
void input(void){
printf(">> "); /* Bash-like input */
scanf("%c", &in); /* Get char input */
run(in);
input(); /* Loop */
}
void run(char c){
/* Boundary checks */
if(x == 256 || ... |
1d573883-fb3f-4a24-9fab-60dc6dce3b5b | {
"language": "C"
} | ```c
/*
* LSAPIC Interrupt Controller
*
* This takes care of interrupts that are generated by the CPU's
* internal Streamlined Advanced Programmable Interrupt Controller
* (LSAPIC), such as the ITC and IPI interrupts.
*
* Copyright (C) 1999 VA Linux Systems
* Copyright (C) 1999 Walt Drummond <drummond@valinu... | ```c
/*
* LSAPIC Interrupt Controller
*
* This takes care of interrupts that are generated by the CPU's
* internal Streamlined Advanced Programmable Interrupt Controller
* (LSAPIC), such as the ITC and IPI interrupts.
*
* Copyright (C) 1999 VA Linux Systems
* Copyright (C) 1999 Walt Drummond <drummond@valinu... |
e90d4b3c-1896-446b-8274-86ccfb42d419 | {
"language": "C"
} | ```c
#ifndef _PURCHASEEVENT_H_
#define _PURCHASEEVENT_H_
#include <Event.h>
class PurchaseEvent : public Event {
public:
enum Type {
PURCHASE_STATUS
};
PurchaseEvent(double _timestamp, int _productId, Type _type, bool _newPurchase) : Event(_timestamp), type(_type), newPurchase(_newPurchase), productId(_produ... | ```c
#ifndef _PURCHASEEVENT_H_
#define _PURCHASEEVENT_H_
#include <Event.h>
class PurchaseEvent : public Event {
public:
enum Type {
PURCHASE_STATUS
};
PurchaseEvent(double _timestamp, std::string _productId, Type _type, bool _newPurchase) : Event(_timestamp), type(_type), newPurchase(_newPurchase), productI... |
2878a5a7-060c-4f38-80d5-c7a866f97e4b | {
"language": "C"
} | ```c
```
Add uobject stub to make the script generator plugin happy | ```c
#pragma once
#include <Engine.h>
#include "StubUObject.generated.h"
// This class is only here to make sure we're visible to UHT.
// We need to be visible to UHT so that UE4HaxeExternGenerator works correctly
// (as any script generator must return a module name that is visible to UHT)
// see IScriptGeneratorPlug... |
c4624d27-a73e-431a-85d8-8e5d5252dbec | {
"language": "C"
} | ```c
// RUN: %clang_cc1 %s -verify -fasm-blocks
#define M __asm int 0x2c
#define M2 int
void t1(void) { M }
void t2(void) { __asm int 0x2c }
void t3(void) { __asm M2 0x2c }
void t4(void) { __asm mov eax, fs:[0x10] }
void t5() {
__asm {
int 0x2c ; } asm comments are fun! }{
}
__asm {}
}
int t6() {
__asm in... | ```c
// REQUIRES: x86-64-registered-target
// RUN: %clang_cc1 %s -verify -fasm-blocks
#define M __asm int 0x2c
#define M2 int
void t1(void) { M }
void t2(void) { __asm int 0x2c }
void t3(void) { __asm M2 0x2c }
void t4(void) { __asm mov eax, fs:[0x10] }
void t5() {
__asm {
int 0x2c ; } asm comments are fun! }{
... |
a00edb68-52cd-4c0b-b456-c398cdd61b5b | {
"language": "C"
} | ```c
// The Mordax Microkernel
// (c) Kristian Klomsten Skordal 2013 <kristian.skordal@gmail.com>
// Report bugs and issues on <http://github.com/skordal/mordax/issues>
#ifndef MORDAX_TYPES_H
#define MORDAX_TYPES_H
#include <stdint.h>
/** Object size type. */
typedef uint32_t size_t;
/** Physical pointer type. */
t... | ```c
// The Mordax Microkernel
// (c) Kristian Klomsten Skordal 2013 <kristian.skordal@gmail.com>
// Report bugs and issues on <http://github.com/skordal/mordax/issues>
#ifndef MORDAX_TYPES_H
#define MORDAX_TYPES_H
#include <stdbool.h>
#include <stdint.h>
/** Object size type. */
typedef uint32_t size_t;
/** Physic... |
ba7c94d5-4a70-422e-87c8-1d16cd36ad98 | {
"language": "C"
} | ```c
#include "bmmap.h"
#include "vty.h"
void bmmap_init() {
}
void bmmap_print() {
vty_puts("BIOS memory map:\n");
vty_printf("%d entries at %p\n",
*bios_memmap_entries_ptr,
bios_memmap_ptr);
vty_printf("ADDR LOW ADDR HI LEN LOW LEN H... | ```c
#include "bmmap.h"
#include "vty.h"
void bmmap_init() {
}
void bmmap_print() {
vty_puts("BIOS memory map:\n");
vty_printf("%d entries at %p\n",
*bios_memmap_entries_ptr,
bios_memmap_ptr);
vty_printf(" ADDR LEN ... |
389d9edb-b85e-4818-908c-5a271c800e13 | {
"language": "C"
} | ```c
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
#define CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
#pragma once
#include "content/bro... | ```c
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
#define CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
#pragma once
#include "content/bro... |
19a5615f-a56b-47c5-ac83-72f9f29bad95 | {
"language": "C"
} | ```c
#ifndef REFLECTIONCOEFFICIENT_H
#define REFLECTIONCOEFFICIENT_H
#include "SidePostprocessor.h"
#include "MooseVariableInterface.h"
class ReflectionCoefficient;
template <>
InputParameters validParams<ReflectionCoefficient>();
class ReflectionCoefficient : public SidePostprocessor, public MooseVariableInterface... | ```c
#pragma once
#include "SidePostprocessor.h"
#include "MooseVariableInterface.h"
class ReflectionCoefficient;
template <>
InputParameters validParams<ReflectionCoefficient>();
class ReflectionCoefficient : public SidePostprocessor, public MooseVariableInterface<Real>
{
public:
ReflectionCoefficient(const Inpu... |
acd579c9-2074-4b51-813d-2a6426da04db | {
"language": "C"
} | ```c
/*
Entry point for the Windows NT DLL.
About the only reason for having this, is so initall() can automatically
be called, removing that burden (and possible source of frustration if
forgotten) from the programmer.
*/
#include "windows.h"
/* NT and Python share these */
#undef INCREF
#undef DECREF
#include "c... | ```c
/*
Entry point for the Windows NT DLL.
About the only reason for having this, is so initall() can automatically
be called, removing that burden (and possible source of frustration if
forgotten) from the programmer.
*/
#include "windows.h"
/* NT and Python share these */
#include "config.h"
#include "Python.h"... |
128960f8-fcc9-4a1f-9b32-484f769eae49 | {
"language": "C"
} | ```c
/*
* Copyright (C) 2014-2015 Pavel Dolgov
*
* See the LICENSE file for terms of use.
*/
#include <stdio.h>
#define TOWER1 1
#define TOWER2 3
void hanoi(int a, int n1, int n2) {
if (a == 1) { // end of recursion
printf("%d %d %d\n", a, n1, n2);
} else {
int x, na;
for (x = T... | ```c
/*
* Copyright (C) 2014-2015 Pavel Dolgov
*
* See the LICENSE file for terms of use.
*/
#include <stdio.h>
#define TOWER1 1
#define TOWER2 3
void hanoi(int a, int n1, int n2) {
if (a == 1) { // end of recursion
printf("%d %d %d\n", a, n1, n2);
} else {
int x, na;
for (x = T... |
fd9c2d63-30aa-4fc3-8b0a-24e91e6e1b0a | {
"language": "C"
} | ```c
#pragma once // This guarantees that the code is included only once in the game.
#include "SFML/Window.hpp"
#include "SFML/Graphics.hpp"
class Game {
public:
// Objects declared static are allocated storage in static storage area, and have scope till the end of the program.
static void Start()... | ```c
#ifndef GAME_H // This guarentees that the code is included only once in the game.
#define GAME_H
#include "SFML/Graphics.hpp"
#include "SFML/Window.hpp"
class Game {
public:
// Objects declared static are allocated storage in static storage area, and have scope till the end of the program.
s... |
b763921d-0573-48e7-9221-11ff4f10accb | {
"language": "C"
} | ```c
#ifndef ELASTIC_H
#define ELASTIC_H
#include "MaterialModel.h"
// Forward declarations
class ElasticityTensor;
class Elastic;
template<>
InputParameters validParams<Elastic>();
class Elastic : public MaterialModel
{
public:
Elastic( const std::string & name,
InputParameters parameters );
virtual... | ```c
#ifndef ELASTIC_H
#define ELASTIC_H
#include "MaterialModel.h"
// Forward declarations
class ElasticityTensor;
class Elastic;
template<>
InputParameters validParams<Elastic>();
class Elastic : public MaterialModel
{
public:
Elastic( const std::string & name,
InputParameters parameters );
virtual... |
7d7e9979-712f-4103-acf1-ddc3218da57a | {
"language": "C"
} | ```c
/*
* dremf() wrapper for remainderf().
*
* Written by J.T. Conklin, <jtc@wimsey.com>
* Placed into the Public Domain, 1994.
*/
#include "math.h"
#include "math_private.h"
float
dremf(x, y)
float x, y;
{
return remainderf(x, y);
}
```
Work around known GCC 3.4.x problem and use ANSI prototype for dremf(). | ```c
/*
* dremf() wrapper for remainderf().
*
* Written by J.T. Conklin, <jtc@wimsey.com>
* Placed into the Public Domain, 1994.
*/
/* $FreeBSD$ */
#include "math.h"
#include "math_private.h"
float
dremf(float x, float y)
{
return remainderf(x, y);
}
``` |
32a693a3-9094-49de-92da-a4046db6832f | {
"language": "C"
} | ```c
```
Add solution for exercise 16. | ```c
#include <stdio.h>
#define MAXLINE 10/*00*/ /* maximum input size */
int _getline(char line[], int maxline);
/* getline is a library function in POSIX; unfortunately on OS X the -ansi flag
doesn't help */
void copy(char to[], char from[]);
main() {
int len;
int max;
char line[MAXLINE];
char ... |
3c75aeb3-b5ad-4e3b-83e4-b5896a53f712 | {
"language": "C"
} | ```c
#include <stddef.h>
extern int debug;
#ifndef NDEBUG
#define DBG(...) dbg(__VA_ARGS__)
#define DBGON() (debug = 1)
#else
#define DBG(...)
#define DBGON()
#endif
#define TINT long long
#define TUINT unsigned long long
#define TFLOAT double
struct items {
char **s;
unsigned n;
};
typedef str... | ```c
#include <stddef.h>
extern int debug;
#ifndef NDEBUG
#define DBG(...) dbg(__VA_ARGS__)
#define DBGON() (debug = 1)
#else
#define DBG(...)
#define DBGON()
#endif
#define TINT long long
#define TUINT unsigned long long
#define TUINT_MAX ULLONG_MAX
#define TINT_MAX LLONG_MAX
#define TFLOAT d... |
e8a31c87-3250-4f3c-9809-31d552544c38 | {
"language": "C"
} | ```c
```
Add test where octApron derives non-integer bounds | ```c
// SKIP PARAM: --sets ana.activated[+] octApron
#include <assert.h>
void main() {
int x;
if (x <= 10) {
assert((x / 3) <= 3);
}
}
``` |
87fee656-cfee-4db5-8789-e2c97d5a97d9 | {
"language": "C"
} | ```c
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "greatest.h"
TEST standalone_pass(void) {
PASS();
}
/* Add all the definitions that need to be in the test runner's main file. */
GREATEST_MAIN_DEFS();
int main(int argc, char **argv) {
(void)argc;
(void)argv;
/* Initializ... | ```c
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "greatest.h"
TEST standalone_pass(void) {
PASS();
}
/* Add all the definitions that need to be in the test runner's main file. */
GREATEST_MAIN_DEFS();
int main(int argc, char **argv) {
struct greatest_report_t report;
(void)argc;
... |
5f869be0-d33e-4790-83c1-e3273081ebee | {
"language": "C"
} | ```c
#ifndef LIBTRADING_BYTE_ORDER_H
#define LIBTRADING_BYTE_ORDER_H
#include "libtrading/types.h"
#include <arpa/inet.h>
static inline be16 cpu_to_be16(u16 value)
{
return htons(value);
}
static inline be32 cpu_to_be32(u32 value)
{
return htonl(value);
}
static inline u16 be16_to_cpu(be16 value)
{
return ntohs... | ```c
#ifndef LIBTRADING_BYTE_ORDER_H
#define LIBTRADING_BYTE_ORDER_H
#include <endian.h>
/*
* Little Endian
*/
static inline le16 cpu_to_le16(u16 value)
{
return htole16(value);
}
static inline le32 cpu_to_le32(u32 value)
{
return htole32(value);
}
static inline le64 cpu_to_le64(u64 value)
{
return htole64(va... |
3def2a65-d85a-4757-85dd-ab80f300c945 | {
"language": "C"
} | ```c
#import <Cocoa/Cocoa.h>
@interface WildcardPattern : NSObject {
NSString* pattern_;
}
- (id) initWithString: (NSString*) s;
- (BOOL) isMatch: (NSString*) s;
@end
```
Add copyright and license header. | ```c
/*
* Copyright (c) 2006 KATO Kazuyoshi <kzys@8-p.info>
* This source code is released under the MIT license.
*/
#import <Cocoa/Cocoa.h>
@interface WildcardPattern : NSObject {
NSString* pattern_;
}
- (id) initWithString: (NSString*) s;
- (BOOL) isMatch: (NSString*) s;
@end
``` |
23a6dee1-fa10-43ac-921e-79b08407bd55 | {
"language": "C"
} | ```c
#ifndef LACO_UTIL_H
#define LACO_UTIL_H
struct LacoState;
struct lua_State;
/**
* Load a line into the lua stack to be evaluated later
*
* param pointer to LacoState
*
* return -1 if there is no line input to load
*/
int laco_load_line(struct LacoState* laco);
/**
* Called after laco_load_line, ... | ```c
#ifndef LACO_UTIL_H
#define LACO_UTIL_H
struct LacoState;
/**
* Load a line into the lua stack to be evaluated later
*
* param pointer to LacoState
*
* return -1 if there is no line input to load
*/
int laco_load_line(struct LacoState* laco);
/**
* Called after laco_load_line, this evaluated the... |
6531240c-b661-45b4-80f0-1d1f81ac9b87 | {
"language": "C"
} | ```c
/*
Copyright 2019 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 t... | ```c
/*
Copyright 2019 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 t... |
9b45acb5-b1be-4dff-b9a4-7f2bf595bdab | {
"language": "C"
} | ```c
```
Test case for historical reasons | ```c
/**
* magical invsqrt function from Quake III code
* see: http://www.codemaestro.com/reviews/9
*/
float InvSqrt(float x)
{
float xhalf = 0.5f*x;
int i = *(int*)&x;
i = 0x5f3759df - (i>>1);
x = *(float*)&i;
x = x*(1.5f-xhalf*x*x);
return x;
}
int main(void) {
int result = InvSqrt(0.00056);
printf("Resu... |
d9c65805-1c2d-4a6c-b6f2-49e56c25e68d | {
"language": "C"
} | ```c
#ifndef DEBUGGER_H
#define DEBUGGER_H
enum DebuggerState {
DEBUGGER_PAUSED,
DEBUGGER_RUNNING,
DEBUGGER_EXITING
};
struct ARMDebugger {
enum DebuggerState state;
struct ARMCore* cpu;
char* lastCommand;
};
void ARMDebuggerInit(struct ARMDebugger*, struct ARMCore*);
void ARMDebuggerRun(struct ARMDebugger*);... | ```c
#ifndef DEBUGGER_H
#define DEBUGGER_H
enum DebuggerState {
DEBUGGER_PAUSED,
DEBUGGER_RUNNING,
DEBUGGER_EXITING
};
struct ARMDebugger {
enum DebuggerState state;
struct ARMCore* cpu;
char* lastCommand;
struct DebugBreakpoint* breakpoints;
};
void ARMDebuggerInit(struct ARMDebugger*, struct ARMCore*);
voi... |
3b78a772-e585-452f-a252-a88f6e5abb35 | {
"language": "C"
} | ```c
#include <stdint.h>
#include <string.h>
#include "obc.h"
#include "system.h"
#include "terminal.h"
void I2CTestCommandHandler(uint16_t argc, char* argv[])
{
UNREFERENCED_PARAMETER(argc);
I2CBus* bus;
if (strcmp(argv[0], "system") == 0)
{
bus = Main.I2C.System;
}
else if (strcmp(... | ```c
#include <stdint.h>
#include <string.h>
#include "obc.h"
#include "system.h"
#include "terminal.h"
void I2CTestCommandHandler(uint16_t argc, char* argv[])
{
UNREFERENCED_PARAMETER(argc);
if (argc != 3)
{
TerminalPuts("i2c <system|payload> <device> <data>\n");
return;
}
I2CBu... |
3db00236-2c31-4cb6-ad40-fc8f2e0e1d87 | {
"language": "C"
} | ```c
/*
Copyright (c) 2012 Curtis Hard - GeekyGoodness
*/
/*
Modified by Denis Zamataev. 2014
*/
#import <Foundation/Foundation.h>
#import <HTMLReader.h>
#import "DZReadability_constants.h"
typedef void (^GGReadabilityParserCompletionHandler)( NSString * content );
typedef void (^GGReadabilityParserErrorHandle... | ```c
/*
Copyright (c) 2012 Curtis Hard - GeekyGoodness
*/
/*
Modified by Denis Zamataev. 2014
*/
#import <Foundation/Foundation.h>
#import "HTMLReader.h"
#import "DZReadability_constants.h"
typedef void (^GGReadabilityParserCompletionHandler)( NSString * content );
typedef void (^GGReadabilityParserErrorHandle... |
68887d52-e2c6-4fc5-9785-b544b141bc67 | {
"language": "C"
} | ```c
//
// Created by Borin Ouch on 2016-03-22.
//
#ifndef SFML_TEST_GAME_STATE_H
#define SFML_TEST_GAME_STATE_H
#include "game.h"
class GameState {
public:
Game* game;
virtual void draw(const float dt) = 0;
virtual void update(const float dt) = 0;
virtual void handleInput() = 0;
};
#endif //SF... | ```c
//
// Created by Borin Ouch on 2016-03-22.
//
#ifndef SFML_TEST_GAME_STATE_H
#define SFML_TEST_GAME_STATE_H
#include "game.h"
class GameState {
public:
Game* game;
virtual void draw(const float dt) = 0;
virtual void update(const float dt) = 0;
virtual void handleInput() = 0;
virtual ~Ga... |
e74be2ee-b44f-4760-ac1d-cd9b5958ca31 | {
"language": "C"
} | ```c
```
Add ensure for runtime assertion checking | ```c
#ifndef __SH_COMMON_H__
#define __SH_COMMON_H__
#include <stdio.h>
#include <stdlib.h>
// ensure is kinda like assert but it is always executed
#define ensure(p, msg) \
do { \
if (!(p)) { ... |
5bb5ab11-a904-47c9-a84e-2629d38373f4 | {
"language": "C"
} | ```c
// This is a queue that can be accessed from multiple threads safely.
//
// It's not well optimized, and requires obtaining a lock every time you check for a new value.
#pragma once
#include <condition_variable>
#include <mutex>
#include <optional>
#include <queue>
template <class T>
class SynchronizedQueue {
... | ```c
// This is a queue that can be accessed from multiple threads safely.
//
// It's not well optimized, and requires obtaining a lock every time you check for a new value.
#pragma once
#include <condition_variable>
#include <mutex>
#include <optional>
#include <queue>
template <class T>
class SynchronizedQueue {
... |
0e24612b-6529-4034-8cbd-5a8e83787590 | {
"language": "C"
} | ```c
#ifndef __GTK_COMPAT_H__
#define __GTK_COMPAT_H__
#include <gtk/gtk.h>
/* Provide a compatibility layer for accessor functions introduced
* in GTK+ 2.21.1 which we need to build with sealed GDK.
* That way it is still possible to build with GTK+ 2.20.
*/
#if (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION < 21)... | ```c
#ifndef __GTK_COMPAT_H__
#define __GTK_COMPAT_H__
#include <gtk/gtk.h>
/* Provide a compatibility layer for accessor functions introduced
* in GTK+ 2.21.1 which we need to build with sealed GDK.
* That way it is still possible to build with GTK+ 2.20.
*/
#if (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION < 21)... |
876d57a8-87eb-41b2-be03-554e29df612e | {
"language": "C"
} | ```c
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "wclock.h"
#ifdef _WIN32
# include <windows.h>
static unsigned int sleep(unsigned int x) { Sleep(x * 1000); return 0; }
#else
# include <unistd.h>
#endif
int main(void)
{
double res, t1, t2;
wclock clock;
if (wclock... | ```c
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "wclock.h"
#ifdef _WIN32
# include <windows.h>
static unsigned int sleep(unsigned int x) { Sleep(x * 1000); return 0; }
#else
# include <unistd.h>
#endif
int main(void)
{
double res, t1, t2;
wclock clock;
if (wclock... |
0dbe8add-a440-4394-93a0-eaa295d2677c | {
"language": "C"
} | ```c
#include <setjmp.h>
#include <stdarg.h>
#include <stddef.h>
#include <cmocka.h>
#include "cbor.h"
#ifndef ASSERTIONS_H_
#define ASSERTIONS_H_
void assert_uint8(cbor_item_t* item, uint8_t num);
void assert_uint16(cbor_item_t* item, uint16_t num);
void assert_uint32(cbor_item_t* item, uint32_t num);
void assert_... | ```c
#include <setjmp.h>
#include <stdarg.h>
#include <stddef.h>
#include <cmocka.h>
#include "cbor.h"
#ifndef ASSERTIONS_H_
#define ASSERTIONS_H_
void assert_uint8(cbor_item_t* item, uint8_t num);
void assert_uint16(cbor_item_t* item, uint16_t num);
void assert_uint32(cbor_item_t* item, uint32_t num);
void assert_... |
b422773e-8043-46bd-854b-1438e21c6f0e | {
"language": "C"
} | ```c
```
Add or replace user extended attributes on a file. | ```c
/* setfattr.c - sets user extended attributes for a file.
*
* This program can be viewed as a much simpler version of setfattr(1) utility,
* used to set, remove and list a file's extended attributes. All this program
* can do, however, is to set user EAs.
*
* Usage
*
* $ ./setfattr <name> <value> <file>... |
0764751e-670f-40a7-aab7-7649be41c421 | {
"language": "C"
} | ```c
#include <sys/types.h>
#include <pthread.h>
#include "vendor/simclist.h"
#ifndef BUZZLOCK_H_
#define BUZZLOCK_H_
#define BZZ_BLACK 1
#define BZZ_GOLD 0
typedef int useconds_t;
typedef struct {
pid_t id;
int color;
double waiting_since;
} bzz_thread_t;
typedef struct {
pthread_mutex_t mutex;
pthread_cond... | ```c
#include <sys/types.h>
#include <unistd.h>
#include <pthread.h>
#include "vendor/simclist.h"
#ifndef BUZZLOCK_H_
#define BUZZLOCK_H_
#define BZZ_BLACK 1
#define BZZ_GOLD 0
typedef struct {
pid_t id;
int color;
double waiting_since;
} bzz_thread_t;
typedef struct {
pthread_mutex_t mutex;
pthread_cond_t c... |
8f2ca986-9f8a-4026-ae7a-c95f2ac9d332 | {
"language": "C"
} | ```c
// Copyright 2011 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 appli... | ```c
// Copyright 2011 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 appli... |
9dfb6bcf-06b8-4ef0-aa28-1c286e160dde | {
"language": "C"
} | ```c
//
// UIKitCategory.h
// WWCategory
//
// Created by ww on 2016. 1. 10..
// Copyright © 2016년 Won Woo Choi. All rights reserved.
//
#import "UIApplication+Keyboard.h"
#import "UIBezierPath+Drawing.h"
#import "UIColor+CreateColor.h"
#import "UIImage+CreateImage.h"
#import "UIImage+ImageProcessing.h"
#import "U... | ```c
//
// UIKitCategory.h
// WWCategory
//
// Created by ww on 2016. 1. 10..
// Copyright © 2016년 Won Woo Choi. All rights reserved.
//
#import "UIApplication+Keyboard.h"
#import "UIApplication+TopmostViewController.h"
#import "UIBarButtonItem+Block.h"
#import "UIBezierPath+Drawing.h"
#import "UIButton+Align.h"
#... |
33301e3e-d57f-4011-b084-d37c87e5bb7b | {
"language": "C"
} | ```c
```
Add unified state of the game | ```c
/*
* Copyright (C) 2015 Luke San Antonio
* All rights reserved.
*/
#pragma once
#include "../common/id_map.hpp"
#include "boat.h"
#include "../collisionlib/motion.h"
namespace redc { namespace sail
{
struct Player
{
std::string name;
bool spawned;
Hull_Desc boat_config;
collis::Motion boat_... |
fc7aebe4-4ebf-4875-a5fb-91b41a8d6349 | {
"language": "C"
} | ```c
/**
* \file inet_ntop
* inet_ntop emulation based on inet_ntoa.
* \author Matthias Andree
*
*/
#include "config.h"
#ifndef HAVE_INET_NTOP
#include "leafnode.h"
#include "mastring.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
#ifdef WITH_D... | ```c
/**
* \file inet_ntop
* inet_ntop emulation based on inet_ntoa.
* \author Matthias Andree
*
*/
#include "config.h"
#if !HAVE_INET_NTOP
#include "leafnode.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
#include <string.h>
const char *
inet... |
1e9e5b65-2716-4192-924c-b8c1f3134e40 | {
"language": "C"
} | ```c
```
Add program for testing large openslide_read_region() calls | ```c
/* Test program to make a single openslide_read_region() call and write the
result as a PPM. */
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <assert.h>
#include <openslide.h>
int main(int argc, char **argv) {
if (argc != 7) {
printf("Arguments: slide out.ppm ... |
90462ac2-1bca-4eef-8ba6-64c46ee444ef | {
"language": "C"
} | ```c
#ifndef ALI_DECAYER__H
#define ALI_DECAYER__H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
#include "RVersion.h"
#include "TVirtualMCDecayer.h"
typedef TVirtualMCDecayer AliDecayer;
#if ROOT_V... | ```c
#ifndef ALI_DECAYER__H
#define ALI_DECAYER__H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
#include "RVersion.h"
#include "TVirtualMCDecayer.h"
typedef TVirtualMCDecayer AliDecayer;
#if ROOT_V... |
5830ad40-c71c-4e05-b82e-8c1d030fa547 | {
"language": "C"
} | ```c
/**
* @file arch/alpha/oprofile/op_impl.h
*
* @remark Copyright 2002 OProfile authors
* @remark Read the file COPYING
*
* @author Richard Henderson <rth@twiddle.net>
*/
#ifndef OP_IMPL_H
#define OP_IMPL_H 1
struct pt_regs;
extern int null_perf_irq(void);
extern int (*perf_irq)(void);
/* Per-counter conf... | ```c
/**
* @file arch/alpha/oprofile/op_impl.h
*
* @remark Copyright 2002 OProfile authors
* @remark Read the file COPYING
*
* @author Richard Henderson <rth@twiddle.net>
*/
#ifndef OP_IMPL_H
#define OP_IMPL_H 1
extern int null_perf_irq(void);
extern int (*perf_irq)(void);
/* Per-counter configuration as set ... |
bd185a12-0d53-41e5-9d39-0f78f303b4d3 | {
"language": "C"
} | ```c
// Test coverage flag.
//
// RUN: %clang_cl -### -coverage %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CLANG-CL-COVERAGE %s
// CLANG-CL-COVERAGE-NOT: error:
// CLANG-CL-COVERAGE-NOT: warning:
// CLANG-CL-COVERAGE-NOT: argument unused
// CLANG-CL-COVERAGE-NOT: unknown argument
```
Add a missing "REQUIRES: syste... | ```c
// Test coverage flag.
// REQUIRES: system-windows
//
// RUN: %clang_cl -### -coverage %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CLANG-CL-COVERAGE %s
// CLANG-CL-COVERAGE-NOT: error:
// CLANG-CL-COVERAGE-NOT: warning:
// CLANG-CL-COVERAGE-NOT: argument unused
// CLANG-CL-COVERAGE-NOT: unknown argument
``` |
cf4945a6-3d03-4567-9490-290e55bec00d | {
"language": "C"
} | ```c
//Basic master parser
extern uint8_t MODBUSParseResponseBasic( union MODBUSParser * );
```
Add passing of request frame to parsing functions | ```c
//Basic master parser
extern uint8_t MODBUSParseResponseBasic( union MODBUSParser *, union MODBUSParser * );
``` |
dd05776f-5e6a-42b1-ab0b-ee9e8099ef3b | {
"language": "C"
} | ```c
#include "../small1/testharness.h"
// NUMERRORS 1
struct foo {
int a[8];
int *b;
} gfoo;
struct bar {
int a[8];
int *b;
};
int main() {
int * __INDEX p = & gfoo.a[2]; // Force gfoo.a to have a length
// This should be Ok, but pbar->b is gfoo.a[7]
struct bar *pbar = (struct bar*)&gfoo;
gfoo.a[... | ```c
#include "../small1/testharness.h"
#include "../small1/testkinds.h"
// NUMERRORS 3
struct foo {
int a[8];
int *b;
} gfoo;
struct bar {
int a[8];
int *b;
};
#if ERROR == 2
struct s1 {
int a[8];
int *b;
} * s1;
struct s2 {
int *c;
int d[8];
} * s2;
#endif
#if ERROR == 3
struct s_with_index {
... |
3938fd7e-f7d3-4d30-bbde-0be93f121fab | {
"language": "C"
} | ```c
```
Update files, Alura, Introdução a C - Parte 2, Aula 4.3 | ```c
#include <stdio.h>
void abertura(int m) {
printf("Tabuada do %d\n", m);
}
int main() {
int multiplicador = 2;
abertura(multiplicador);
for(int i = 1; i <= 10; i++) {
printf("%d x %d = %d\n", multiplicador, i, multiplicador * i);
}
}
``` |
68105878-a8bd-4874-909f-59a8c485a82c | {
"language": "C"
} | ```c
```
Test for parsing assignment in a ?:'s rhs | ```c
// RUN: %check -e %s
f(int a, int b, int dir)
{
struct
{
int x, y;
} c = { };
a & b ? c.x += dir : c.y += dir; // CHECK: error: assignment to int/if - not an lvalue
}
``` |
a5f968bd-4787-4176-b6eb-39693a994a1b | {
"language": "C"
} | ```c
```
Add an empty header that will contain defines concerning the document structure | ```c
/* libvisio
* Copyright (C) 2011 Fridrich Strba <fridrich.strba@bluewin.ch>
* Copyright (C) 2011 Eilidh McAdam <tibbylickle@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Fo... |
ec188191-de44-49d5-944d-e1a6253c7983 | {
"language": "C"
} | ```c
#pragma once
#include <boost/container/vector.hpp>
#include "System.h"
class Renderer : public System {
protected:
uint16_t width = 1280;
uint16_t height = 720;
Decimal fovPlus = glm::radians(10.0f);
Decimal zNear = 0.05f;
Decimal zFar = 48.0f;
Decimal pixelDistanceFromScreen = 1000.0f;
public:
bool showF... | ```c
#pragma once
#include <boost/container/vector.hpp>
#include "System.h"
class Renderer : public System {
protected:
uint16_t width = 1280;
uint16_t height = 720;
Decimal fovPlus = glm::radians(10.0f);
Decimal zNear = 0.05f;
Decimal zFar = 48.0f;
Decimal pixelDistanceFromScreen = 1000.0f;
public:
bool showF... |
b665c24e-bfd2-41a8-b785-60506a06ce5c | {
"language": "C"
} | ```c
// library.h
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CON... | ```c
// library.h
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CON... |
15f99403-7cc2-4556-b22e-4acc38aa303a | {
"language": "C"
} | ```c
```
Add test case for casting addresses to function pointers | ```c
void abort();
int add(int a, int b) { return a + b; }
int sub(int a, int b) { return a - b; }
int mul(int a, int b) { return a * b; }
int div(int a, int b) { return a / b; }
int rem(int a, int b) { return a % b; }
long *arr[5] = {(long *)&add, (long *)&sub, (long *)&mul, (long *)&div, (long *)&rem };
int main(... |
1fc766f2-c98d-4d21-95d1-1c07a8d150d3 | {
"language": "C"
} | ```c
/** @file
@brief Header
@date 2014
@author
Ryan Pavlik
<ryan@sensics.com>
<http://sensics.com>
*/
// Copyright 2014 Sensics, Inc.
//
// All rights reserved.
//
// (Final version intended to be licensed under
// the Apache License, Version 2.0)
#ifndef INCLUDED_ServerPtr_h_GUID_ED06F093_... | ```c
/** @file
@brief Header
@date 2014
@author
Ryan Pavlik
<ryan@sensics.com>
<http://sensics.com>
*/
// Copyright 2014 Sensics, Inc.
//
// All rights reserved.
//
// (Final version intended to be licensed under
// the Apache License, Version 2.0)
#ifndef INCLUDED_ServerPtr_h_GUID_ED06F093_... |
6087caa9-b685-49fe-99e3-94ff28c91254 | {
"language": "C"
} | ```c
//
// UIView+Sizing.h
// aaah
//
// Created by Stanislaw Pankevich on 5/10/13.
// Copyright (c) 2013 IProjecting. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIView (Sizing)
@property CGPoint origin;
@property CGSize size;
@property CGFloat x;
@property CGFloat y;
@property CGFloat height;
@... | ```c
// Inspired by FrameAccessor
// https://github.com/AlexDenisov/FrameAccessor/
#import <UIKit/UIKit.h>
@interface UIView (Sizing)
@property CGPoint origin;
@property CGSize size;
@property CGFloat x;
@property CGFloat y;
@property CGFloat height;
@property CGFloat width;
@property CGFloat centerX;
@property CG... |
9785104a-71c6-4848-8e95-b24b9b3e879a | {
"language": "C"
} | ```c
//
// os/winapi/alloc.h: Low-level WinAPI-based allocators.
//
// CEN64: Cycle-Accurate Nintendo 64 Simulator.
// Copyright (C) 2014, Tyler J. Stachecki.
//
// This file is subject to the terms and conditions defined in
// 'LICENSE', which is part of this source code package.
//
#include "common.h"
#include "os/c... | ```c
//
// os/winapi/alloc.h: Low-level WinAPI-based allocators.
//
// CEN64: Cycle-Accurate Nintendo 64 Simulator.
// Copyright (C) 2014, Tyler J. Stachecki.
//
// This file is subject to the terms and conditions defined in
// 'LICENSE', which is part of this source code package.
//
#include "common.h"
#include "os/c... |
4c3c438c-9e5a-46df-a921-ac2f96114395 | {
"language": "C"
} | ```c
```
Add header to extend server for arduinojson | ```c
// ESPasyncJson.h
/*
Async Response to use with arduinoJson and asyncwebserver
Written by Andrew Melvin (SticilFace) with help from me-no-dev and BBlanchon.
example of callback in use
server.on("/json", HTTP_ANY, [](AsyncWebServerRequest * request) {
AsyncJsonResponse * response = new AsyncJsonResp... |
d44eeeb3-8bb9-4bde-be72-428eb84ac259 | {
"language": "C"
} | ```c
#pragma once
#include <unistd.h>
#include <algorithm>
#include <exception>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>
const std::string BotVersion ("3.0.0-d... | ```c
#pragma once
#include <unistd.h>
#include <algorithm>
#include <cstdarg>
#include <exception>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <thread>
#include <tuple>
#include <unordered_map>
... |
f5b96b43-71d7-4b2e-a272-39e3d0b4f0e9 | {
"language": "C"
} | ```c
/*
* Game.h
*
* Created on: 30.12.2016
* Author: Stefan
*/
#include "Deck.h"
#include "Dealer.h"
#include <memory>
#include "GlobalDeclarations.h"
#include "PlayerStrategy.h"
#ifndef GAME_H_
#define GAME_H_
// Class game is the glue code which binds all other classes together.
// It guides the game.
... | ```c
/*
* Game.h
*
* Created on: 30.12.2016
* Author: Stefan
*/
#include "Deck.h"
#include "Dealer.h"
#include <memory>
#include "GlobalDeclarations.h"
#include "PlayerStrategy.h"
#ifndef GAME_H_
#define GAME_H_
// Class game is the glue code which binds all other classes together.
// It guides the game.
... |
ca5dd301-99b4-4501-941f-811c89802ae3 | {
"language": "C"
} | ```c
```
Add StreamRedirector class to handle stream resetting with RAII. | ```c
#include <libmesh/libmesh.h>
/**
* This class uses RAII to control redirecting the libMesh::err stream
* to NULL and restoring it around some operation where we do not want
* to see output to the screen.
*/
class StreamRedirector
{
public:
/**
* Constructor; saves the original libMesh::err streambuf.
... |
898fa203-6ace-4158-b972-2a9132a18aab | {
"language": "C"
} | ```c
#include <stdio.h>
#include "aes.h"
int
main(int argc, char **argv)
{
aes_init();
return 0;
}
```
Allow specifying number of blocks to test | ```c
#include <stdio.h>
#include <stdlib.h>
#include "aes.h"
int
main(int argc, char **argv)
{
long blocks;
char *nptr;
aes_init();
blocks = 10;
if (argc > 1)
{
long b = strtol(argv[1], &nptr, 10);
if (argv[1] != nptr)
{
blocks = b;
}
}
return 0;
}
``` |
def0d5ec-471e-4dbb-acd8-e55a99403951 | {
"language": "C"
} | ```c
/*
* Copyright 2010 The Android Open Source Project
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkTextFormatParams_DEFINES
#define SkTextFormatParams_DEFINES
#include "include/core/SkScalar.h"
#include "include/core/SkTypes.h"
// Fract... | ```c
/*
* Copyright 2010 The Android Open Source Project
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkTextFormatParams_DEFINES
#define SkTextFormatParams_DEFINES
#include "include/core/SkScalar.h"
#include "include/core/SkTypes.h"
// The f... |
071485ab-e4fc-4027-b625-87a2ecc0f701 | {
"language": "C"
} | ```c
// @(#)root/sqlite:$Id$
// Author: o.freyermuth <o.f@cern.ch>, 01/06/2013
/*************************************************************************
* Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* ... | ```c
// @(#)root/sqlite:
// Author: o.freyermuth <o.f@cern.ch>, 01/06/2013
/*************************************************************************
* Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* ... |
e90bb45d-7c8b-4cab-a00b-e0ac75cfee89 | {
"language": "C"
} | ```c
// REQUIRES: nozlib
// RUN: %clang -### -fintegrated-as -gz -c %s 2>&1 | FileCheck %s -check-prefix CHECK-WARN
// RUN: %clang -### -fintegrated-as -gz=none -c %s 2>&1 | FileCheck -allow-empty -check-prefix CHECK-NOWARN %s
// CHECK-WARN: warning: cannot compress debug sections (zlib not installed)
// CHECK-NOWARN... | ```c
// REQUIRES: !zlib
// RUN: %clang -### -fintegrated-as -gz -c %s 2>&1 | FileCheck %s -check-prefix CHECK-WARN
// RUN: %clang -### -fintegrated-as -gz=none -c %s 2>&1 | FileCheck -allow-empty -check-prefix CHECK-NOWARN %s
// CHECK-WARN: warning: cannot compress debug sections (zlib not installed)
// CHECK-NOWARN-... |
69bf8d07-2014-44b6-994a-688303d80ccd | {
"language": "C"
} | ```c
//
// The MIT License (MIT)
//
// Copyright (c) 2015 Stefano Falda (stefano.falda@gmail.com)
//
// 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 ... | ```c
//
// The MIT License (MIT)
//
// Copyright (c) 2015 Stefano Falda (stefano.falda@gmail.com)
//
// 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 ... |
6cd1cd5c-4a95-4583-8a3c-4703c12d973b | {
"language": "C"
} | ```c
#include <stdio.h>
#include "bincookie.h"
int main(int argc, char *argv[]) {
if (argc != 2) {
printf("Usage: %s [Full path to Cookies.binarycookies file]\n", argv[0]);
printf("Example: %s Cookies.binarycookies\n", argv[0]);
return 1;
}
binarycookies_t *bc = binarycookies_init... | ```c
#include <stdio.h>
#include "bincookie.h"
int main(int argc, char *argv[]) {
if (argc != 2) {
printf("Usage: %s [Full path to Cookies.binarycookies file]\n", argv[0]);
printf("Example: %s Cookies.binarycookies\n", argv[0]);
return 1;
}
binarycookies_t *bc = binarycookies_init... |
52c8e583-0643-4b9b-8350-b376f072aa88 | {
"language": "C"
} | ```c
#include <stdio.h>
#include <string.h>
#ifdef WIN32
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT extern
#endif
DLLEXPORT void * ReturnSomePointer()
{
char *x = "Got passed back the pointer I returned";
return x;
}
DLLEXPORT int CompareSomePointer(void *ptr)
{
int x = strcmp("Got p... | ```c
#include <stdio.h>
#include <string.h>
#ifdef WIN32
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT extern
#endif
DLLEXPORT void * ReturnSomePointer()
{
return strdup("Got passed back the pointer I returned");
}
DLLEXPORT int CompareSomePointer(void *ptr)
{
int x = strcmp("Got passed bac... |
a82642d1-f5c8-43da-82c4-4b36f7861258 | {
"language": "C"
} | ```c
/*
Copyright libCellML Contributors
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 writing, s... | ```c
/*
Copyright libCellML Contributors
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 writing, s... |
627182b0-4ca3-4c0e-8727-450d2c7a1b80 | {
"language": "C"
} | ```c
```
Add FCoE feature header to 82599 | ```c
/*******************************************************************************
Intel 10 Gigabit PCI Express Linux driver
Copyright(c) 1999 - 2009 Intel Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
... |
473508b4-f1dd-4bb6-8f3d-727d79fd5aba | {
"language": "C"
} | ```c
//
// NSTimeZone+Offset.h
// CocoaGit
//
// Created by Geoffrey Garside on 28/07/2008.
// Copyright 2008 ManicPanda.com. All rights reserved.
//
#import <Foundation/NSTimeZone.h>
@interface NSTimeZone (Offset)
+ (id)timeZoneWithStringOffset:(NSString*)offset;
- (NSString*)offsetString;
@end
```
Add documen... | ```c
//
// NSTimeZone+Offset.h
// CocoaGit
//
// Created by Geoffrey Garside on 28/07/2008.
// Copyright 2008 ManicPanda.com. All rights reserved.
//
#import <Foundation/NSTimeZone.h>
@interface NSTimeZone (Offset)
/*! Creates and returns a time zone with the specified offset.
* The string is broken down into t... |
dc072924-597e-42ad-bd13-d78e71511481 | {
"language": "C"
} | ```c
// Filename: audio.h
// Created by: frang (06Jul00)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should h... | ```c
// Filename: audio.h
// Created by: frang (06Jul00)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should h... |
1bc5aef4-3a5b-4b79-9d67-46cec95e3ee0 | {
"language": "C"
} | ```c
// The MIT License (MIT)
//
// Copyright (c) 2014-present James Ide
//
// 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
// ... | ```c
// The MIT License (MIT)
//
// Copyright (c) 2014-present James Ide
//
// 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
// ... |
0f6d0559-3420-4592-83e6-e65a436b4a88 | {
"language": "C"
} | ```c
#define _XOPEN_SOURCE 500 /* mkstemp */
#include <stdlib.h>
#include <unistd.h>
#include "tmpfile.h"
#include "alloc.h"
int tmpfile_prefix_out(const char *prefix, char **const fname)
{
char *tmppath;
int fd;
char *tmpdir = getenv("TMPDIR");
#ifdef P_tmpdir
if(!tmpdir)
tmpdir = P_tmpdir;
#endif
if(!tmpdir... | ```c
#define _XOPEN_SOURCE 500 /* mkstemp */
#include <stdlib.h>
#include <unistd.h>
#include "tmpfile.h"
#include "alloc.h"
int tmpfile_prefix_out(const char *prefix, char **const fname)
{
char *tmppath;
int fd;
char *tmpdir = getenv("TMPDIR");
#ifdef P_tmpdir
if(!tmpdir)
tmpdir = P_tmpdir;
#endif
if(!tmpdir... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.