repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
nygrenj/Windows-iotcore-samples | Samples/VirtualMicrophoneArrayDriver/Cpp/VirtualAudioMicArray/minipairs.h | /*++
Copyright (c) Microsoft Corporation All Rights Reserved
Module Name:
minipairs.h
Abstract:
Local audio endpoint filter definitions.
--*/
#ifndef _SYSVAD_MINIPAIRS_H_
#define _SYSVAD_MINIPAIRS_H_
#include "micarraytopo.h"
#include "micarray1toptable.h"
#include "micarraywavtable.h"
NTSTATUS
Create... |
nygrenj/Windows-iotcore-samples | Samples/VirtualMicrophoneArrayDriver/Cpp/VirtualAudioMicArray/VirtualPin.h | <reponame>nygrenj/Windows-iotcore-samples
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
#pragma once
#define MS_TO_100NS(x) ((x) * 10LL * 1000)
class VirtualPin;
class CMiniportWaveRTStream;
class InputPin
{
public:
KsPin* m_pKsPin;
UNICODE_STRING m_DeviceName;
BOOLEAN m_bPresent;
... |
nygrenj/Windows-iotcore-samples | Demos/PetDoor/cpp/MotionSensor.h | <filename>Demos/PetDoor/cpp/MotionSensor.h
#pragma once
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::Devices::Enumeration;
using namespace Windows::Devices::Gpio;
using namespace Windows::UI::Xaml;
using namespace Windows::Sys... |
nygrenj/Windows-iotcore-samples | Samples/VirtualMicrophoneArrayDriver/Cpp/VirtualAudioMicArray/VirtualAudioMicArray.h | <gh_stars>1000+
/*++
Copyright (c) Microsoft Corporation All Rights Reserved
Module Name:
Sysvad.h
--*/
#ifndef _SYSVAD_H_
#define _SYSVAD_H_
#pragma once
#include <portcls.h>
#include <stdunk.h>
#include <ksdebug.h>
#include <ntintsafe.h>
#include <wdf.h>
#include <wdfminiport.h>
#include <intrin.h>
#include <... |
nygrenj/Windows-iotcore-samples | Samples/InternetRadio/CPP/lib/UniversalMediaEngine/UniversalMediaEngine/pch.h | <reponame>nygrenj/Windows-iotcore-samples<gh_stars>100-1000
#pragma once
#include <collection.h>
#include <ppltasks.h>
#include <Winstring.h>
#include <Unknwn.h>
#include <Mfapi.h>
#include <Mfmediaengine.h>
#include <Audioclient.h>
#include <mfidl.h>
#include "MediaState.h"
using namespace Microsoft::WRL;
#defin... |
nygrenj/Windows-iotcore-samples | Samples/GpioOneWire/CPP/MainPage.xaml.h | // Copyright (c) Microsoft. All rights reserved.
//
// MainPage.xaml.h
// Declaration of the MainPage class.
//
#pragma once
#include "MainPage.g.h"
namespace GpioOneWire
{
struct DhtSensorReading {
bool IsValid ( ) const
{
unsigned long long value = this->bits.to_ullong();
... |
nygrenj/Windows-iotcore-samples | Samples/VirtualMicrophoneArrayDriver/Cpp/VirtualAudioMicArray/minwavertstream.h | <reponame>nygrenj/Windows-iotcore-samples
/*++
Copyright (c) 1997-2010 Microsoft Corporation All Rights Reserved
Module Name:
minwavert.h
Abstract:
Definition of wavert miniport class.
--*/
#ifndef _SYSVAD_MINWAVERTSTREAM_H_
#define _SYSVAD_MINWAVERTSTREAM_H_
//
// Structure to store notifications ... |
nygrenj/Windows-iotcore-samples | Demos/PetDoor/cpp/Servo.h | #pragma once
#include <Lightning.h>
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::Devices::Enumeration;
using namespace Windows::Devices::Gpio;
using namespace Windows::UI::Xaml;
using namespace Windows::System::Threading;
usi... |
nygrenj/Windows-iotcore-samples | Samples/InternetRadio/CPP/InternetRadioDevice/InternetRadioAllJoyn/pch.h | <filename>Samples/InternetRadio/CPP/InternetRadioDevice/InternetRadioAllJoyn/pch.h
//-----------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code... |
akurmustafa/utils_rand | utils/rand.h |
#ifndef UTILS_RAND_H
#define UTILS_RAND_H
#include <algorithm>
#include <cassert>
#include <chrono>
#include <iostream>
#include <numeric>
#include <random>
#include <type_traits>
#include <stdexcept>
#include <vector>
namespace utils_rand
{
// all declarations in the namespace utils_rand
// Returns a random intege... |
cmclean/GLnexus | include/cli_utils.h | <gh_stars>0
#ifndef GLNEXUS_APPLET_UTILS_H
#define GLNEXUS_APPLET_UTILS_H
#include <string>
#include <vector>
#include <map>
#include "types.h"
#include "spdlog/spdlog.h"
#include "RocksKeyValue.h"
#include "BCFKeyValueData.h"
#include "unifier.h"
namespace GLnexus {
namespace cli {
namespace utils {
bool detect_jem... |
cmclean/GLnexus | src/BCFKeyValueData_utils.h | // Helper code for BCFKeyValueData.cc
#include <capnp/message.h>
#include <capnp/serialize.h>
#include <defs.capnp.h>
#include "KeyValue.h"
#include "BCFSerialize.h"
const uint64_t MAX_NUM_CONTIGS_PER_GVCF = 16777216; // 3 bytes wide
const uint64_t MAX_CONTIG_LEN = 1099511627776; // 5 bytes wide
const uint64_t M... |
henrykrumb/Adafruit_MLX90393_Library | Adafruit_MLX90393.h | <filename>Adafruit_MLX90393.h
/******************************************************************************
This is a library for the MLX90393 magnetometer.
Designed specifically to work with the MLX90393 breakout from Adafruit:
----> https://www.adafruit.com/products/4022
These sensors use I2C to communic... |
pb-students/SO-07-pthreads | main2.c | <filename>main2.c
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#define THREADS 10
void* thread (void* arg) {
int n = rand() % 10001;
for (int i = 0; i < n; ++i) {
printf("Thread #%ld, i = %d\n", (long) arg, i);
}
pthread_exit((void*) (intptr_t) n);
}
int m... |
pb-students/SO-07-pthreads | main.c | <gh_stars>1-10
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
int counter = 0;
void* increment (void* arg) {
while (1) {
++counter;
sleep(1);
}
}
void* print (void* arg) {
while (1) {
printf("counter = %d\n", counter);
sleep(1);
}
}
in... |
djdjocker/pimanager | manager/overscan/overscreen.c | /****************************************************************
* overscan.c version 1.0.1 -- get/set overscan values on the fly
* to use this standalone you will need to create the mailbox
* device first. sudo mknod /dev/mailbox c 100 0
* if used with the set_overscan.sh script this is not necessary
***********... |
willyii/CppND-System-Monitor-Project-Updated | include/processor.h | <reponame>willyii/CppND-System-Monitor-Project-Updated<gh_stars>0
#ifndef PROCESSOR_H
#define PROCESSOR_H
#include <vector>
using std::vector;
class Processor {
public:
Processor();
float Utilization(); // TODO: See src/processor.cpp
// DONE: Declare any necessary private members
private:
long prevIdle =... |
zranger1/PixelTeleporter | servers/Pi/pbxTeleporter/pbxTeleporter.c | /* pbxTeleporter.c
*
* Serial -> UDP Bridge for Pixelblaze
* Linux/Raspberry Pi version
*
* Reads data from a Pixelblaze by emulating a single (8 channel, 2048 pixel) output expander
* board and forwards it over the network via UDP datagram on request. The wire protocol is
* described in <NAME>'s Pixelblaze Out... |
zranger1/PixelTeleporter | servers/Pi/pbxTeleporter/udpServer.c | <reponame>zranger1/PixelTeleporter
/* udpServer.c
*
* Serial -> UDP Bridge for Pixelblaze
* Linux/Raspberry Pi version
*
* Reads data from a Pixelblaze by emulating a single (8 channel, 2048 pixel) output expander
* board and forwards it over the network via UDP datagram on request. The wire protocol is
* descr... |
zranger1/PixelTeleporter | servers/Pi/pbxTeleporter/pbxTeleporter.h | /* pbxTeleporter.h
*
* Serial -> UDP Bridge for Pixelblaze
* Linux/Raspberry Pi version
*
* Reads data from a Pixelblaze by emulating a single (8 channel, 2048 pixel) output expander
* board and forwards it over the network via UDP datagram on request. The wire protocol is
* described in <NAME>'s Pixelblaze Out... |
iotbzh/agl-spotify-binding | src/agl-spotify-binding.c | /*
* Copyright (C) 2015, 2016, 2017 "IoT.bzh"
* Author: <NAME> <<EMAIL>>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless ... |
WikiBotFoundation/pymol-open-source | layer3/SpecRec.h | #pragma once
#include"PyMOLObject.h"
#include"CGO.h"
/**
* Specification record (a row in the object menu panel)
*/
class SpecRec {
public:
/* NOTE: must zero-init with CALLOC */
int type;
WordType name; /*only used for selections */
CObject *obj;
SpecRec *next;
int visible; /*... |
JinduYin/Python-2.5.6 | test_code/chapter1/long_size.c | <filename>test_code/chapter1/long_size.c
#include <stdio.h>
int main(){
printf("sizeof(long) = %zu\n", sizeof(long));
return 0;
}
|
JinduYin/Python-2.5.6 | test_code/chapter1/struct_size.c | <gh_stars>0
#include <stdio.h>
typedef struct _object {
long ob_size;
long *ob_type;
long ob_ival;
} PyObject;
#define N_INTOBJECTS 41
struct _intblock {
PyObject objects[N_INTOBJECTS];
};
typedef struct _intblock PyIntBlock;
int main(){
PyObject *p;
p = (PyObject *) malloc(sizeof(PyIntBloc... |
fulup-bzh/mbtiles-cpp | Include/vector_tile21/vector_tile.pb.h | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: vector_tile.proto
#ifndef PROTOBUF_vector_5ftile_2eproto__INCLUDED
#define PROTOBUF_vector_5ftile_2eproto__INCLUDED
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 3000000
#error This file was generated ... |
fulup-bzh/mbtiles-cpp | Include/VectorTile.h | #ifndef _VECTOR_TILE_H
#define _VECTOR_TILE_H
#include <string>
#include <map>
#include <vector>
#include "vector_tile21/vector_tile.pb.h"
typedef std::pair<double, double> Point2D;
typedef std::pair<int, int> Point2Di;
typedef std::vector<Point2D> LineLoop2D;
typedef std::vector<Point2Di> LineLoop2Di;
typedef std::p... |
toseertc/TSRtc-iOS-macOS-Demos | macOSDemo/Common/TSMView.h | //
// TSMView.h
// macOSDemo
//
// Created by yxibng on 2020/11/22.
//
#import <Cocoa/Cocoa.h>
NS_ASSUME_NONNULL_BEGIN
IB_DESIGNABLE
@interface TSMView : NSView
@property (nonatomic, strong) IBInspectable NSColor *backgroundColor;
@property (nonatomic, assign) BOOL disableEvents;
/*
是否是遮罩view
遮罩拦截事件向下传递
*/
@p... |
readysetawesome/VESCBrakesCanOrSerial | Serial_CAN_Firmware/func.h | <reponame>readysetawesome/VESCBrakesCanOrSerial
// function
#ifndef __FUNC_H__
#define __FUNC_H__
// EEPROM
extern void initEEPROM();
extern void showConfig(unsigned char c);
extern unsigned long readWord(int addr);
extern void writeWord(int addr, unsigned long dta);
// workding mode
extern void eventSerialCan();
e... |
readysetawesome/VESCBrakesCanOrSerial | Serial_CAN_Firmware/firmware_dfs.h | // dfs
#ifndef __FIRMWARE_DFS_H__
#define __FIRMWARE_DFS_H__
// EEPROM
#define EEPADDR_SET (0)
#define EEPADDR_SERIAL (1)
#define EEPADDR_CANRATE (2)
#define EEPADDR_MASK0 (10)
#define EEPADDR_MASK1 (20)
#define EEPADDR_FILT0 (30)
#define EEPADDR_FILT1 (40)
#define EEPADDR_FILT2 (50)
#define EEPADDR_... |
mfkiwl/Bedrock | soc/picorv32/test/i2c/i2c.c | <filename>soc/picorv32/test/i2c/i2c.c
#include <stdint.h>
#include "settings.h"
#include "gpio.h"
#include "timer.h"
#include "i2c_soft.h"
int main(void) {
uint8_t testData[8];
i2c_init(PIN_I2C_SDA, PIN_I2C_SCL);
// Read N bytes
i2c_read_regs(0x42, 0x24, testData, sizeof(testData));
// Send N by... |
mfkiwl/Bedrock | soc/picorv32/firmware/src/i2c_soft.c | <filename>soc/picorv32/firmware/src/i2c_soft.c
#include "i2c_soft.h"
#include <stdint.h>
#include "gpio.h"
#include "timer.h"
#include "settings.h"
#include "common.h"
#include "print.h"
//-------------------------------------------------
// Private macros /functions
//-------------------------------------------------... |
mfkiwl/Bedrock | soc/picorv32/firmware/inc/timer.h | #ifndef TIMER_H
#define TIMER_H
//-------------------------------------------------------------
// A basic timer API based on the RISCV rdcycle register
//-------------------------------------------------------------
#include <stdint.h>
#include "settings.h"
// Convert microseconds to clock cycles
#define US_TO_CYCLES... |
mfkiwl/Bedrock | soc/picorv32/test/uart_fifo/uart_fifo.c | #include <stdint.h>
#include <string.h>
#include "common.h"
#include "settings.h"
#include "uart.h"
const char buf_tx[] = "PI IS EXACTLY THREE!!!\n";
#define N_CHARS 23
char buf_rx[N_CHARS];
void uart_recv(char *p, unsigned len) {
uint16_t c;
for (unsigned i=0; i<len; i++){
do {
c = UART_G... |
mfkiwl/Bedrock | soc/picorv32/firmware/src/onewire_soft.c | <gh_stars>10-100
#include <stdint.h>
#include <stdbool.h>
#include "gpio.h"
#include "timer.h"
#include "settings.h"
#include "common.h"
#include "onewire_soft.h"
// pre-calculated memory addresses for
// setting / clearing / reading the one-wire pin
static unsigned p_high;
static unsigned p_low;
static unsigned p_rd;... |
mfkiwl/Bedrock | soc/picorv32/firmware/inc/spi.h | #ifndef SPI_H
#define SPI_H
#include <stdint.h>
#include "common.h"
#include "sfr.h"
#define SPI_DAT_REG 0
#define SPI_CFG_REG 1
#define BIT_CLK_DIV 0 // 8 bit spi clock prescaler (halfperiod cycle count)
// F_SCK = F_CLK / CLK_DIV / 2
#define BIT_NBITS 8 // Send / Receive N b... |
mfkiwl/Bedrock | soc/picorv32/firmware/inc/onewire_soft.h | <filename>soc/picorv32/firmware/inc/onewire_soft.h
#ifndef ONEWIRE_SOFT_H
#define ONEWIRE_SOFT_H
#include <stdint.h>
#include <stdbool.h>
//-------------------------------------------------
// Onewire bit-bang library
//-------------------------------------------------
// * set BASE_ONEWIRE at compile time
// * bus mu... |
mfkiwl/Bedrock | soc/picorv32/project/cmod_a7/common/system.c | #include <stdint.h>
#include "settings.h"
#include "irqs.h"
#include "print.h"
#include "uart.h"
#include "gpio.h"
#include "timer.h"
#include "test.h"
#include "spi_memio.h"
void donut(void);
#define LED(val) SET_GPIO8(BASE_GPIO, GPIO_OUT_REG, 0, ((~val) & 0x7))
#ifdef SIMULATION
// Need to speed up things when... |
mfkiwl/Bedrock | badger/tests/udp_model.h | <gh_stars>10-100
#ifndef UDP_MODEL_H
#define UDP_MODEL_H
#ifdef __cplusplus
extern "C" {
#endif
extern unsigned short udp_port; /* Global */
extern int badger_client; /* Global */
void udp_receiver(int *in_octet, int *in_valid, int *in_count, int thinking);
void udp_sender(int out_octet, int out_end);
#ifdef __cplusp... |
mfkiwl/Bedrock | badger/tests/ethernet_model.h | <filename>badger/tests/ethernet_model.h<gh_stars>10-100
#ifndef ETHERNET_MODEL_H
#define ETHERNET_MODEL_H
#ifdef __cplusplus
extern "C" {
#endif
int ethernet_model(int out_octet, int out_valid, int *in_octet, int *in_valid, int thinking);
#ifdef __cplusplus
}
#endif
#endif
|
mfkiwl/Bedrock | soc/picorv32/firmware/src/print.c | #include <stdint.h>
#include "print.h"
// Stub to prevent linker errors. User shall redefine this function!
void __attribute__((weak)) _putchar(char c)
{
(void)c;
}
void print_str(const char *p)
{
while (*p != 0)
_putchar(*(p++));
}
// returns number of characters written to buf
static unsigned udec(... |
mfkiwl/Bedrock | soc/picorv32/test/onewire/onewire.c | <gh_stars>10-100
#include <string.h>
#include "settings.h"
#include "onewire_soft.h"
#include "common.h"
#include "print.h"
#include "timer.h"
#define DEBUG_CONSOLE_BASE 0x02
void _putchar(char c)
{
SET_REG(DEBUG_CONSOLE_BASE << 24, c);
}
int main(void)
{
uint8_t testData[8];
// Must match parameter rom... |
mfkiwl/Bedrock | soc/picorv32/firmware/inc/print.h | <filename>soc/picorv32/firmware/inc/print.h
//-------------------------------------------------------------
// Minimalistic print functions
//-------------------------------------------------------------
// Note that the _putchar function needs to be implemented by the user!
// For example to print to UART, add this li... |
mfkiwl/Bedrock | soc/picorv32/project/kc705/common/system.c | #include <stdint.h>
#include "settings.h"
#include "print.h"
#include "uart.h"
#include "i2c_soft.h"
#include "lcd.h"
#include "gpio.h"
#include "timer.h"
#define P_UART (1<<0)
#define P_LCD (1<<1)
// print to: 1=UART, 2=LCD, 3=BOTH
unsigned g_printTo = P_UART;
void _putchar(char c)
{
if(g_printTo & P_UART) UAR... |
eilims/Comp322 | SideProjects/PThreadEx/pThreadEx.c | <reponame>eilims/Comp322
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
int count = 0;
void* print6(void* arg)
{
count++;
printf("Thread Void* Address: %d\n", arg);
printf("Thread1 Int Address: %d\n", (int*)arg);
printf("Thread1 Int Value: %d\n", *(int*)arg);
}
//We may only pass a void poin... |
eilims/Comp322 | SideProjects/LibraryEx/DLExample.c | #include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>
int main (int argc, char** argv)
{
void* handle;
//This is a symbol
double (*sine)(double);
char* error;
//Open the math library
handle = dlopen("libm.so.6", RTLD_LAZY);
//Returns null if it fails. null void pointers are false
if (!h... |
eilims/Comp322 | Lab3/Lab3.c | #include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <pwd.h>
#include <dirent.h>
#include <libgen.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
int pd[2];
int c;
//Types
//2 = owner
//1 = group
//0 = general
void checkPer... |
eilims/Comp322 | SideProjects/ArrayPractice/charArray.c | #include <stdio.h>
#include <string.h>
int main (int argc, char** argv)
{
if (argc != 1)
{
printf("Not + 1: %d\n", strlen(argv[1]));
printf("+ 1: %d\n", strlen(argv[1]) + 1);
}
}
|
eilims/Comp322 | Lab5/main.c | <reponame>eilims/Comp322
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
int main(int argc, char** argv)
{
pid_t pid = getpid();
//Create server process
pid_t cpid = fork();
if (cpid == 0)
{
char* temp[3];
temp[0] = "./server";
temp[1] = argv[2];
temp[2] = ... |
eilims/Comp322 | SideProjects/TempFolder/temp.c | #include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
int write_temp_file(char* word, int length)
{
}
void read_temp_file(int fileHandle)
{
}
int main(int argc, char** argv)
{
}
|
eilims/Comp322 | SideProjects/SignalTest/signalTest.c | <reponame>eilims/Comp322<filename>SideProjects/SignalTest/signalTest.c
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <sys/types.h>
sig_atomic_t count;
void handler(int signal_number)
{
count++;
}
int main(int argc, char** argv)
{
//Create struct to allow for the easy ... |
eilims/Comp322 | SideProjects/methodFork/methodFork.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
printf("Testing \n");
exit(1);
return 1;
}
|
eilims/Comp322 | SideProjects/Thermostat/thermostat.c | <gh_stars>0
#include <stdio.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <assert.h>
#include <fcntl.h>
#include <stdlib.h>
//Global Variables
//Pipe Setup
//Send data on currentTemp and setTemp
int tempToParent[2];
int parentTempReq[2];
int tempToChild[2];
//Send dat... |
eilims/Comp322 | SideProjects/PThreadEx/logEx.c | #include <stdio.h>
int main(int argc, char** argv)
{
sprintf("New Name",
}
|
eilims/Comp322 | SideProjects/MakePractice/src/main.c | <reponame>eilims/Comp322<filename>SideProjects/MakePractice/src/main.c
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char **argv)
{
int i;
i = atoi (argv[1]);
printf("The entered number fits %d times into 100\n" , intDivide(i));
return 0;
}
|
eilims/Comp322 | Lab5/client.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <unistd.h>
void error(char *msg)
{
perror(msg);
exit(0);
}
int main(int argc, char *argv[])
{
int sockfd, portno, n;
struct so... |
eilims/Comp322 | SideProjects/PointerEx/HelloWorld.c | <filename>SideProjects/PointerEx/HelloWorld.c
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
int main(int argc, char** argv)
{
printf("Hello World!\n");
pid_t pid = getpid();
pid_t cpid = fork();
switch (cpid)
{
case -1:
//Error goes h... |
eilims/Comp322 | SideProjects/PointerEx/pointerEx.c | <gh_stars>0
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
int main(int argc, char** argv)
{
int* test;
int original = 5;
test = &original;
printf("Test: %d\n", test);
printf("Original Address: %d\n", &original);
printf("Orignial: %d\n", original);
printf("Test Value: %d\n", *test);
... |
eilims/Comp322 | SideProjects/CommandLineOptions/commandLineOptions.c | #include <getopt.h>
#include <stdio.h>
int main(int argc, char* argv[])
{
//getopt struct from setting options for passing parameters
//char* long_name, int followingArgument, char* flagUsage, char short_name
const struct option long_options[] =
{
{ "help" , 0, NULL, 'h' },
{ "test" , 1, NULL, 't' },
... |
eilims/Comp322 | Lab5/server.c | <filename>Lab5/server.c
/* A simple server in the internet domain using TCP
* The port number is passed as an argument */
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
void error(char *msg)
{
perror(... |
eilims/Comp322 | SideProjects/LibraryEx/tifftest.c | #include <stdio.h>
#include <tiffio.h>
int main (int argc, char** argv)
{
TIFF* tiff;
tiff = TIFFOpen (argv[1], "r");
TIFFClose (tiff);
return 0;
}
|
eilims/Comp322 | Lab4/improvedLab4.c | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/syscall.h>
#include <unistd.h>
#include <pthread.h>
#include <semaphore.h>
//Semaphore declarations
//A customer is waiting
sem_t customer_sem;
//The barber finishes a haircut
sem_t barber_sem;
//Custo... |
eilims/Comp322 | Lab4/Lab4.c | <filename>Lab4/Lab4.c
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/syscall.h>
#include <unistd.h>
#include <pthread.h>
#include <semaphore.h>
//Semaphore declarations
//A customer is waiting
sem_t customer_sem;
//The barber finishes a haircut
sem... |
eilims/Comp322 | SideProjects/PThreadEx/threadRace.c | #include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
//Number that determines current state of the race
int count = 0;
//Controls when program ends (when one thread reaches 100,000)
int quit = 0;
//Controls starting time to roughly synchornize threads
int start = 0;
//Decrement Function
voi... |
eilims/Comp322 | Lab2/Lab2.c | #include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
int main(int argc, char *argv[])
{
time_t startTime = time(0);
pid_t cpid = getpid();
pid_t pid = getpid();
printf("Parent PID: %d\n", cpid);
int i;
for (i = 1... |
eilims/Comp322 | SideProjects/ArrayPractice/arrayPractice.c | <reponame>eilims/Comp322<gh_stars>0
#include <stdio.h>
//Arrays are passed as pointers
//There is no way to get the size of the array unless it is passed in or stored somewhere
//You can store it in a struct or allocate data + 1 and store the length in therex
void arrayMod(int array[])
{
printf("Function Array Add... |
eilims/Comp322 | SideProjects/EnviromentalTest/enviroment.c | <gh_stars>0
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char* argv)
{
extern char** environ;
char** var;
unsetenv("ALIOSHA");
setenv("ALIOSHA", "alive", 0);
for (var = environ; *var != NULL; ++var)
{
//var => memory address of memory address of start of char[]
//... |
InnerMongoliaZorro/GetWiFiSSID | WiFi-SSID/WiFi-SSID/LCGetWiFiSSID.h | //
// LCGetWiFiSSID.h
// WiFi-SSID
//
// Created by MoGo on 16/3/24.
// Copyright © 2016年 李策--MoGo--. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface LCGetWiFiSSID : NSObject
/**
*SSID(Service Set Identifier)也可以写为ESSID,用来区分不同的网络,最多可以有32个字符,无线网卡通过连接不同的SSID(即AP)并输入相应AP的密码就可以进入不同网络,SSID通常由AP广播出... |
ShabanKamell/HandyX | Pods/Target Support Files/BulletinBoard/BulletinBoard-umbrella.h | #ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "BLTNBoard.h"
#import "BLTNActionItem.h"
#import "BLTNItem.h"
#import "BLTNPageItem.h"
FOUNDATION_EXPORT double BLTN... |
ShabanKamell/HandyX | Pods/BulletinBoard/Sources/Models/BLTNItem.h | /**
* BulletinBoard
* Copyright (c) 2017 - present <NAME>. Licensed under the MIT license.
*/
@import UIKit;
@class BLTNItemManager;
/**
* An item that can be displayed inside a bulletin card.
*/
@protocol BLTNItem <NSObject>
#pragma mark - Configuration
/**
* The current object managing the item.
*
* T... |
ShabanKamell/HandyX | Questions/Questions/Supporting Files/Questions.h | <reponame>ShabanKamell/HandyX<gh_stars>0
//
// Questions.h
// Questions
//
// Created by mac on 11/11/19.
// Copyright © 2019 sha. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for Questions.
FOUNDATION_EXPORT double QuestionsVersionNumber;
//! Project version string for Qu... |
ShabanKamell/HandyX | SubServices/SubServices/Supporting Files/PostDetail.h | <gh_stars>0
//
// PostDetail.h
// PostDetail
//
// Created by mac on 11/11/19.
// Copyright © 2019 sha. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for PostDetail.
FOUNDATION_EXPORT double PostDetailVersionNumber;
//! Project version string for PostDetail.
FOUNDATION_EXPO... |
ShabanKamell/HandyX | Pods/BulletinBoard/Sources/Models/BLTNPageItem.h | <reponame>ShabanKamell/HandyX
/**
* BulletinBoard
* Copyright (c) 2017 - present <NAME>. Licensed under the MIT license.
*/
@import UIKit;
#import "BLTNActionItem.h"
@class BLTNTitleLabelContainer;
NS_ASSUME_NONNULL_BEGIN
/**
* A standard bulletin item with a title and optional additional informations. It ca... |
ShabanKamell/HandyX | App/Presentation.framework/Headers/Presentation-Swift.h | // Generated by Apple Swift version 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgcc-compat"
#if !defined(__has_include)
# define __has_include(x) 0
#endif
#if !defined(__has_attribute)
# define __has_attribute(x) 0
#endif
#if !defined(__has_feature)... |
ericonr/ef | util.c | #include <stdlib.h>
#include <unistd.h>
#include "util.h"
void read_entries_from_stream(struct str_array *a, int delim, FILE *input)
{
char *line = NULL;
size_t tmp = 0;
ssize_t n;
while ((n = getdelim(&line, &tmp, delim, input)) >= 0) {
if (n == 1) {
/* don't match empty line */
free(line);
continue;
... |
ericonr/ef | util.h | #ifndef UTIL_H
#define UTIL_H
#include <stdio.h>
#include "string-array.h"
void read_entries_from_stream(struct str_array *, int, FILE *);
void *xmalloc(size_t);
void *xrealloc(void *, size_t);
#endif
|
ericonr/ef | ef.c | #define _XOPEN_SOURCE 700
#include <stdlib.h>
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include <stdbool.h>
#include <string.h>
#include <malloc.h>
#include <locale.h>
#include <curses.h>
#include "string-array.h"
#include "util.h"
static void endwin_void(void)
{
endwin();
}
static const char *fi... |
ericonr/ef | string-array.c | #define _GNU_SOURCE
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include "string-array.h"
#include "util.h"
void add_entry(struct str_array *a, char *s)
{
if (a->n == a->c) {
if (a->c == 0) a->c = 32;
else a->c *= 2;
a->v = xrealloc(a->v, sizeof(*a->v) * a->c);
a->m = xreall... |
ericonr/ef | string-array.h | #ifndef STRING_ARRAY_H
#define STRING_ARRAY_H
#include <stdbool.h>
struct str_array {
/* strings in the array */
char **v;
/* flag to say if they fit a certain condition or not */
bool *m;
/* total number of true in m */
size_t ms;
/* number of elements, maximum number of elements */
size_t n, c;
};
static ... |
sujith-kumara/datastructures.c | qlist.c | //implement queue using linked list
#include<stdio.h>
#include<stdlib.h>
struct NODE{
int data;
struct NODE*link;
};
typedef struct NODE node;
node*rear;
node*front;
void insert(int value)
{
node*newnode=(node*)malloc(sizeof(node));
newnode->data=value;
newnode->link=NULL;
if(rear==NULL)
{
rear=newnode;
front=... |
sujith-kumara/datastructures.c | quick1.c | <gh_stars>0
// quick sort
#include<stdio.h>
void swap(int*p,int*q)
{
int temp;
temp=*p;
*p=*q;
*q=temp;
}
int partition(int a[],int start,int finish)
{
int i,j,key;
key=a[start];
i=start+1;
j=finish;
do
{
while(i<=finish&&a[i]<key)
{i++;}
while(j>start&&a[j]>key)
{j--;}
if(i<j)
{swap(&a... |
sujith-kumara/datastructures.c | sdemo.c | #include<stdio.h>
#include<malloc.h>
struct link
{
int item;
struct link *next;
} ;
typedef struct link node;
node *top=NULL;
node *newnode(int val)
{ node *p;
p=(node *)malloc(sizeof(node));
p->item=val;
p->next=NULL;
}
void displaystack()
{
node *curr;
curr=top;
while(curr!=NULL)
... |
sujith-kumara/datastructures.c | stacklink.c | // implement stack using linked list
#include<stdio.h>
#include<stdlib.h>
struct NODE
{
int data;
struct NODE*link;
};
typedef struct NODE node;
node*top=NULL;
void push(int value)
{
node*temp=(node*)malloc(sizeof(struct NODE));
temp->data=value;
temp->link=top;
top=temp;
}
void pop()
{
node*del=top;
if(top!=NU... |
sujith-kumara/datastructures.c | polymulti4.c | <gh_stars>0
//multiplication of two polynomials
#include<stdio.h>
#include<malloc.h>
struct link
{
int coeff;
int expo;
struct link*next;
};
//typedef struct link poly;
/*poly*/struct link *poly1, *poly2, *poly3;
/*poly*/struct link newnode(int coeff,int expo)
{
/*poly*/struct link *temp;
temp=(struct link* )mallo... |
sujith-kumara/datastructures.c | structarray.c | <gh_stars>0
#include<stdio.h>
#include<string.h>
struct Book{
int id,prize;
char name[100];
}b[3];
void main()
{
int i,max=3;
for(i=0;i<max;i++)
{
printf("enter book %d id\n",i+1);
scanf("%d",&b[i].id);
printf("enter book %d name\n",i+1);
scanf("%s",b[i].name);
printf("enter book %d pri... |
sujith-kumara/datastructures.c | struct2.c | #include<stdio.h>
#include<string.h>
struct Book{
int id,prize;
char name[100];
}b1,b2;
void main()
{
printf("enter book1 id\n");
scanf("%d",&b1.id);
printf("enter book1 name\n");
scanf("%s",b1.name);
printf("enter book1 prize\n");
scanf("%d",&b1.prize);
printf("enter book2 id\n");
scanf("%d",&b... |
sujith-kumara/datastructures.c | selection.c | //selection sort using function
#include<stdio.h>
void swap(int*p,int*q)
{
int temp;
temp=*p;
*p=*q;
*q=temp;
}
void selectionsort(int a[],int n)
{
int p,q,ind,temp,key;
for(p=0;p<n-1;p++)
{
key=a[p];
ind=p;
for(q=p+1;q<n;q++)
{
if(a[q]<key)
{
key=a[q];
ind=q;
}
}
swap(&a[p],&a[ind]... |
sujith-kumara/datastructures.c | singlylinkedlist2.c | <reponame>sujith-kumara/datastructures.c<gh_stars>0
#include<stdio.h>
#include<malloc.h>
struct NODE
{
int item;
struct NODE *link;
};
typedef struct NODE node;
node *head=NULL;
node*newnode(int val)
{
node*p;
p=(node*)malloc(sizeof(node));
p->item=val;
p->link=NULL;
}
void display()
{
node *curr;
curr=head;
w... |
sujith-kumara/datastructures.c | singlylinkedlist1.c | <reponame>sujith-kumara/datastructures.c
#include<stdio.h>
#include<malloc.h>
struct NODE
{
int item;
struct NODE *link;
};
typedef struct NODE node;
node*newnode(int val)
{
node*p;
p=(node*)malloc(sizeof(node));
p->item=val;
p->link=NULL;
}
void display(node*h)
{
node *curr;
curr=h;
while(curr!=NULL)
{
pri... |
sujith-kumara/datastructures.c | structpointer.c | #include<stdio.h>
#include<string.h>
struct Book{
int id,prize;
char name[100];
}b,*b1;
void main()
{
b1=&b;
printf("enter book id\n");
scanf("%d",&b.id);
printf("enter book name\n");
scanf("%s",b.name);
printf("enter book prize\n");
scanf("%d",&b.prize);
printf("book id=%d\n",b1->id);
printf("bo... |
sujith-kumara/datastructures.c | stack.c | // simple stack
#include<stdio.h>
#define max 20
int top=0;
int isempty()
{
if(top==0)
return (1);
else
return (0);
}
int isfull()
{
if(top==max)
return (1);
else
return (0);
}
void push(int stack[],int item)
{
if(!isfull)
{
stack[top]=item;
top++;}
else
printf... |
sujith-kumara/datastructures.c | polymulti2.c | //multiplication of two polynomials
#include<stdio.h>
#include<malloc.h>
struct link
{
int coeff;
int expo;
struct link*next;
};
typedef struct link poly;
poly *poly1, *poly2, *poly3;
poly *newnode(int coeff,int expo)
{
poly *temp;
temp=(poly*)malloc(sizeof(poly));
temp->coeff = coeff;
temp->expo = expo;
temp->... |
sujith-kumara/datastructures.c | stacklink1.c | <filename>stacklink1.c
#include<stdio.h>
#include<malloc.h>
struct NODE
{
int item;
struct NODE *link;
};
typedef struct NODE node;
node *top=NULL;
node *newnode(int val)
{
node *p;
p=(node*)malloc(sizeof(node));
p->item=val;
p->link=NULL;
}
void displaystack()
{
node *curr;
curr=top;
while(curr!=NULL)
{
pr... |
sujith-kumara/datastructures.c | structfunc.c | // structure using function
void bookprint(struct book);
struct book{
int id,price;
char name[100];
}b;
void main()
{
printf("enter book id\n");
scanf("%d",&b.id);
printf("book name\n);
scanf("%s",b.name);
printf("enter prize");
scanf("%d",&price);
bookprint(b);
}
void bookprint(struct book b1)
{
printf("bo... |
waneon/windows-magnifier | src/Magnifier.h | <gh_stars>1-10
#include <functional>
#include <utility>
class Magnifier {
private:
float mag_level;
int dead_zone;
std::function<int(int)> transform_x;
std::function<int(int)> transform_y;
public:
static const float DEFAULT_MAG_LEVEL;
static const int DEFAULT_DEAD_ZONE = 200;
bool ... |
ladyhavoc/lhcodeutilities | lhcode_buffers.h | <gh_stars>0
// Copyright (c) 2021, <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 con... |
rs0h/jemalloc | include/jemalloc/internal/extent.h | #ifndef JEMALLOC_INTERNAL_EXTENT_H
#define JEMALLOC_INTERNAL_EXTENT_H
#include "jemalloc/internal/ecache.h"
#include "jemalloc/internal/ehooks.h"
#include "jemalloc/internal/ph.h"
#include "jemalloc/internal/rtree.h"
/*
* This module contains the page-level allocator. It chooses the addresses that
* allocations re... |
rs0h/jemalloc | test/unit/thread_event.c | #include "test/jemalloc_test.h"
TEST_BEGIN(test_next_event_fast_roll_back) {
tsd_t *tsd = tsd_fetch();
te_ctx_t ctx;
te_ctx_get(tsd, &ctx, true);
te_ctx_last_event_set(&ctx, 0);
te_ctx_current_bytes_set(&ctx, TE_NEXT_EVENT_FAST_MAX - 8U);
te_ctx_next_event_set(tsd, &ctx, TE_NEXT_EVENT_FAST_MAX);
#define E(event... |
rs0h/jemalloc | src/ehooks.c | #include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
#include "jemalloc/internal/ehooks.h"
#include "jemalloc/internal/extent_mmap.h"
void
ehooks_init(ehooks_t *ehooks, extent_hooks_t *extent_hooks, unsigned ind) {
/* All other hooks are optional; this one is not... |
rs0h/jemalloc | test/unit/prof_recent.c | <reponame>rs0h/jemalloc<filename>test/unit/prof_recent.c<gh_stars>0
#include "test/jemalloc_test.h"
#include "jemalloc/internal/prof_recent.h"
/* As specified in the shell script */
#define OPT_ALLOC_MAX 3
/* Invariant before and after every test (when config_prof is on) */
static void confirm_prof_setup(tsd_t *tsd)... |
rs0h/jemalloc | src/buf_writer.c | #define JEMALLOC_BUF_WRITER_C_
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
#include "jemalloc/internal/buf_writer.h"
#include "jemalloc/internal/malloc_io.h"
static void *
buf_writer_allocate_internal_buf(tsdn_t *tsdn, size_t buf_len) {
#ifdef JEMALLOC_JE... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.