repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
LaPlaceMedia/LPMPod
Example/Pods/Target Support Files/Pods-LPMPod_Tests/Pods-LPMPod_Tests-umbrella.h
<gh_stars>0 #ifdef __OBJC__ #import <UIKit/UIKit.h> #endif FOUNDATION_EXPORT double Pods_LPMPod_TestsVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_LPMPod_TestsVersionString[];
LaPlaceMedia/LPMPod
Example/Pods/Target Support Files/LPMPod/LPMPod-umbrella.h
<filename>Example/Pods/Target Support Files/LPMPod/LPMPod-umbrella.h<gh_stars>0 #ifdef __OBJC__ #import <UIKit/UIKit.h> #endif FOUNDATION_EXPORT double LPMPodVersionNumber; FOUNDATION_EXPORT const unsigned char LPMPodVersionString[];
helospark/pic-tetris
main.c
// CONFIG #pragma config FOSC = HS // Oscillator Selection bits (HS oscillator) #pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled) #pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled) #pragma config BOREN = OFF // Brown-out Reset Enable bit (BOR disabled) #pr...
helospark/pic-tetris
timer.c
<filename>timer.c #include "timer.h" void initTimer(Timer* timer) { timer->firstByte = 0; timer->secondByte = 0; } char hasTimerExpired(Timer* timer, unsigned char a) { return timer->secondByte >= a; } void updateTimer(Timer* timer) { timer->firstByte += 1; if (timer->firstByte >= 255) { ...
helospark/pic-tetris
tetrisDrawer.c
<reponame>helospark/pic-tetris<filename>tetrisDrawer.c #include <stdlib.h> #include <xc.h> #include "global.h" #include "tetrisLogic.h" #include "map.h" #define PORTA_TYPE 0 #define PORTB_TYPE 1 #define PORTC_TYPE 2 #define PORTD_TYPE 3 #define PORTE_TYPE 4 typedef struct { unsigned char registerType; unsigne...
helospark/pic-tetris
map.c
#include <stdio.h> #include <stdlib.h> #include "map.h" unsigned char mapValueAt(int y, int x) { unsigned char row = map.rows[y]; return (row & (0b00000001 << x)) >> x; } void setMapValue(int y, int x, unsigned char value) { if (value == 0) { map.rows[y] &= ~(0b00000001 << x); } else { ...
helospark/pic-tetris
inputHandler.c
#include <xc.h> #include "inputHandler.h" #define LEFT_BIT_INDEX 0 #define RIGHT_BIT_INDEX 1 #define ROTATE_BIT_INDEX 2 // Button pressed logic is inverted, since button pulls pin to ground #define BUTTON_PRESSED_STATE 0 int lastButtonStates[3]; int lastRead = 0; unsigned char readUserInput() { char leftBit = ...
helospark/pic-tetris
tetrisLogic.c
#include <stdio.h> #include "tetrisLogic.h" #include "map.h" #define NUMBER_OF_SHAPES 7 #define SHAPE_HOLDER_HEIGHT 2 #define SHAPE_HOLDER_WIDTH 4 unsigned char TETRIS_SHAPES[NUMBER_OF_SHAPES][8] = { { 0,1,0,0, 1,1,1,0 }, { 1,1,1,1, 0,0,0,0 }, { 1,1,0,0, 0...
helospark/pic-tetris
inputHandler.h
#ifndef INPUTHANDLER_H #define INPUTHANDLER_H #define NO_INPUT 0 #define LEFT 1 #define RIGHT 2 #define ROTATE 3 unsigned char readUserInput(); #endif /* INPUTHANDLER_H */
helospark/pic-tetris
tetrisDrawer.h
<filename>tetrisDrawer.h #include "global.h" #ifndef TETRISDRAWER_H #define TETRISDRAWER_H void drawMap(); #endif /* TETRISDRAWER_H */
helospark/pic-tetris
timer.h
<filename>timer.h #ifndef TIMER_H #define TIMER_H // two byte counter on a single byte computer typedef struct { unsigned int firstByte; unsigned int secondByte; } Timer; void initTimer(Timer* timer); char hasTimerExpired(Timer* timer, unsigned char a); void updateTimer(Timer* timer); #endif /* TIMER_H */ ...
helospark/pic-tetris
global.h
#ifndef GLOBAL_H #define GLOBAL_H // Note: with current design width can only be 8 // due to the limitation of bits per port and the limitation of memory #define WIDTH 8 #define HEIGHT 16 // 16MHz #define _XTAL_FREQ 16000000 // Size of the shape the current user is holding. // this is larger than the shape's actual ...
helospark/pic-tetris
tetrisLogic.h
<reponame>helospark/pic-tetris #include "global.h" #ifndef TETRISLOGIC_H #define TETRISLOGIC_H int currentX; int currentY; char currentShape[CURRENT_BLOCK_HEIGHT][CURRENT_BLOCK_WIDTH]; char hasCurrentShape = 0; void initTetris(); void updateTetris(); char hasGameEnded(); void rotateCurrentShape(); void moveCurre...
helospark/pic-tetris
map.h
<reponame>helospark/pic-tetris #include "global.h" #ifndef MAP_H #define MAP_H typedef struct { unsigned char rows[HEIGHT]; // WIDTH is implicitly 8 } Map; Map map; unsigned char mapValueAt(int y, int x); void setMapValue(int y, int x, unsigned char value); char isRowFilledCompletely(int y); void moveRowsDown(i...
CatixBot/ServoCalibrationTool
src/ServoCalibrationTool.h
<gh_stars>0 #pragma once #include "ServoCalibrationToolWindow.h" #include <ros/ros.h> #include <catix_messages/CalibrationLimitValue.h> #include <catix_messages/CalibrationPointValue.h> #include <catix_messages/SignalingChannelState.h> #include <catix_messages/ServoState.h> //---------------------------------------...
CatixBot/ServoCalibrationTool
src/ServoCalibrationToolWindow.h
<filename>src/ServoCalibrationToolWindow.h #pragma once #include <QWidget> QT_BEGIN_NAMESPACE namespace Ui { class ServoCalibrationToolWindow; } QT_END_NAMESPACE class ServoCalibrationToolWindow : public QWidget { Q_OBJECT public: ServoCalibrationToolWindow(QWidget *parent = nullptr); ~ServoCalibrationT...
gye-ul/poseidonos
test/unit-tests/rebuild/segment_based_rebuild_mock.h
#include <gmock/gmock.h> #include <string> #include <list> #include <vector> #include "src/rebuild/segment_based_rebuild.h" namespace pos { class MockSegmentBasedRebuild : public SegmentBasedRebuild { public: using SegmentBasedRebuild::SegmentBasedRebuild; MOCK_METHOD(bool, Read, (), (override)); MOCK_METH...
gye-ul/poseidonos
test/unit-tests/journal_manager/log_buffer/journal_log_buffer_mock.h
<gh_stars>1-10 #include <gmock/gmock.h> #include <list> #include <string> #include <vector> #include "src/journal_manager/log_buffer/journal_log_buffer.h" namespace pos { class MockJournalLogBuffer : public JournalLogBuffer { public: using JournalLogBuffer::JournalLogBuffer; MOCK_METHOD(int, Init, (JournalCo...
gye-ul/poseidonos
src/journal_manager/log_buffer/journal_log_buffer.h
/* * BSD LICENSE * Copyright (c) 2021 Samsung Electronics Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain th...
gye-ul/poseidonos
test/unit-tests/array/partition/partition_manager_mock.h
<gh_stars>1-10 #include <gmock/gmock.h> #include <list> #include <string> #include <vector> #include "src/array/partition/partition_manager.h" namespace pos { class MockPartitionManager : public PartitionManager { public: using PartitionManager::PartitionManager; MOCK_METHOD(const PartitionLogicalSize*, GetS...
gye-ul/poseidonos
test/unit-tests/allocator/context_manager/rebuild_ctx/rebuild_ctx_mock.h
#include <gmock/gmock.h> #include <set> #include <string> #include <list> #include <vector> #include "src/allocator/context_manager/rebuild_ctx/rebuild_ctx.h" namespace pos { class MockRebuildCtx : public RebuildCtx { public: using RebuildCtx::RebuildCtx; MOCK_METHOD(void, SetAllocatorFileIo, (AllocatorFileIo*...
gye-ul/poseidonos
test/integration-tests/metafs/metafs_test_fixture.h
/* * BSD LICENSE * Copyright (c) 2021 Samsung Electronics Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain th...
gye-ul/poseidonos
test/unit-tests/allocator/allocator_mock.h
<reponame>gye-ul/poseidonos<gh_stars>1-10 #include <gmock/gmock.h> #include <string> #include <list> #include <vector> #include "src/allocator/allocator.h" namespace pos { class MockAllocator : public Allocator { public: using Allocator::Allocator; MOCK_METHOD(int, Init, (), (override)); MOCK_METHOD(void, ...
gye-ul/poseidonos
test/unit-tests/allocator/context_manager/segment_ctx/segment_list_mock.h
<filename>test/unit-tests/allocator/context_manager/segment_ctx/segment_list_mock.h #include <gmock/gmock.h> #include <set> #include <string> #include <list> #include <vector> #include "src/allocator/context_manager/segment_ctx/segment_list.h" namespace pos { class MockSegmentList : public SegmentList { public: us...
gye-ul/poseidonos
test/unit-tests/rebuild/stripe_based_race_rebuild_mock.h
#pragma once #include <gmock/gmock.h> #include <string> #include <list> #include <vector> #include "src/rebuild/stripe_based_race_rebuild.h" namespace pos { class MockStripeBasedRaceRebuild : public StripeBasedRaceRebuild { public: using StripeBasedRaceRebuild::StripeBasedRaceRebuild; MOCK_METHOD(bool, Read, ...
gye-ul/poseidonos
test/integration-tests/journal/fake/wbstripe_allocator_mock.h
<gh_stars>1-10 #pragma once #include <map> #include "gmock/gmock.h" #include "src/allocator/i_wbstripe_allocator.h" namespace pos { class WBStripeAllocatorMock : public IWBStripeAllocator { public: WBStripeAllocatorMock(void) {} virtual ~WBStripeAllocatorMock(void) {} MOCK_METHOD(void, SetActiveStripeTa...
gye-ul/poseidonos
test/unit-tests/allocator/i_wbstripe_allocator_mock.h
#include <gmock/gmock.h> #include <string> #include <list> #include <vector> #include "src/allocator/i_wbstripe_allocator.h" namespace pos { class MockIWBStripeAllocator : public IWBStripeAllocator { public: using IWBStripeAllocator::IWBStripeAllocator; MOCK_METHOD(Stripe*, GetStripe, (StripeAddr& lsa), (overr...
gye-ul/poseidonos
src/array/device/array_device_manager.h
<gh_stars>1-10 /* * BSD LICENSE * Copyright (c) 2021 Samsung Electronics Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code...
gye-ul/poseidonos
proto/generated/cpp/metric.pb.h
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: metric.proto #ifndef GOOGLE_PROTOBUF_INCLUDED_metric_2eproto #define GOOGLE_PROTOBUF_INCLUDED_metric_2eproto #include <limits> #include <string> #include <google/protobuf/port_def.inc> #if PROTOBUF_VERSION < 3015000 #error This file was generated...
gye-ul/poseidonos
test/unit-tests/allocator/wbstripe_manager/wbstripe_manager_mock.h
#include <gmock/gmock.h> #include <string> #include <list> #include <set> #include <vector> #include "src/allocator/wbstripe_manager/wbstripe_manager.h" namespace pos { class MockWBStripeManager : public WBStripeManager { public: using WBStripeManager::WBStripeManager; MOCK_METHOD(void, Init, (), (override)); ...
NHTHEBEST-LLC/NOS
src/kernel/main.c
#include <screen.h> #include <NOS.h> void main() { clearScreen(); NOS(); kshell(); }
NHTHEBEST-LLC/NOS
src/include/screen.h
#ifndef SCREEN_H #define SCREEN_H #include <types.h> #include <ports.h> int cursorX , cursorY; const uint8 sw ,sh ,sd ; void clearLine(uint8 from,uint8 to); void clearScreen();// void scrollUp(uint8 lineNumber);// void printch(char c); void print (string ch); int printf (const char* str, ...);// void setc...
NHTHEBEST-LLC/NOS
src/kernel/kshell.c
<reponame>NHTHEBEST-LLC/NOS<gh_stars>1-10 #include <screen.h> #include <ver.h> #include <types.h> #include <keyboard.h> #include <libk.h> #include <NOS.h> void help(char* cmd); void exit(char* cmd); void kshell(void) { printf("\nKShell Version %d.%d Build %d\n\n", MAJOR, MINOR, BUILD); bool R...
NHTHEBEST-LLC/NOS
src/kernel/system/libk.c
<reponame>NHTHEBEST-LLC/NOS #include <libk.h> uint16_t strlen(string ch) { uint16_t i = 0; while (ch[i++]); return i-1; } string decToHexa(int n) { // char array to store hexadecimal number char hexaDeciNum[100]; // counter for hexadecimal number array int i = 0; while(n!=...
NHTHEBEST-LLC/NOS
src/include/libk.h
#ifndef LIBK_H #define LIBK_H #include <types.h> uint16_t strlen(string ch); string decToHexa(int n); string int_to_string(int n); void int_to_ascii(int n, char str[]); void * malloc(int nbytes); int strncmp (const char *s1, const char *s2, size_t n); void * memset (void *dstpp, int c, size_t len); void * mem...
NHTHEBEST-LLC/NOS
src/kernel/screen/printf.c
<filename>src/kernel/screen/printf.c<gh_stars>1-10 #include <printf.h> void __itoa_s(int i,unsigned base,char* buf) { if (base > 16) return; if (i < 0) { *buf++ = '-'; i *= -1; } __itoa(i,base,buf); } char tbuf[32]; char bchars[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','...
NHTHEBEST-LLC/NOS
src/include/keyboard.h
<filename>src/include/keyboard.h<gh_stars>1-10 #ifndef KB_H #define KB_H #include <screen.h> #include <types.h> char * readStr(); #endif
NHTHEBEST-LLC/NOS
src/include/bios32.h
#ifndef BIOS32 #define BIOS32 typedef struct __attribute__ ((packed)) { unsigned short di, si, bp, sp, bx, dx, cx, ax; unsigned short gs, fs, es, ds, eflags; } regs16_t; extern void _cdelc biosint32(unsigned char intnum, regs16_t *regs); #endif
NHTHEBEST-LLC/NOS
src/include/ver.h
#ifndef __VER_H__ #define __VER_H__ // major #ifdef __MAJOR_VER #define MAjOR __MAJOR_VER #else #define MAJOR 0 #endif // minor #ifdef __MINOR_VER #define MINOR __MINOR_VER #else #define MINOR 1 #endif // build number #ifdef __BUILD_NUMBER #define BUILD __BUILD_NUMBER #else #define BUILD 0 #end...
NHTHEBEST-LLC/NOS
src/include/ports.h
#ifndef PORTS_H #define PORTS_H #include <types.h> uint8_t inb (uint16_t port); void outb (uint16_t port, uint8_t data); #define inportb(port) inb(port) #define outportb(port,data) outb(port,data) #endif
NHTHEBEST-LLC/NOS
src/include/types.h
<reponame>NHTHEBEST-LLC/NOS #ifndef TYPES_H #define TYPES_H typedef signed char int8; typedef unsigned char uint8; typedef signed short int16; typedef unsigned short uint16; typedef signed int int32; typedef unsigned int uint32; typedef signed long long int64; typedef unsigned long long uint64; ////...
NHTHEBEST-LLC/NOS
src/kernel/start.c
#include <types.h> #include <bios32.h> extern void _start(); extern void main(); void start() { /* * get kernel start * get kernel end * init * call main */ print("In start\n"); printf("_start = %x\n", _start); main(); hlt(); }
NHTHEBEST-LLC/NOS
src/kernel/screen/screen.c
#include <screen.h> bool textmode = true; void print (string ch) { uint16 i = 0; uint8 length = strlen(ch); //Updated (Now we store string length on a variable to call the function only once) for(i;i<length;i++) { printch(ch[i]); } } void printch(char ch) { if(textmode){ ...
NHTHEBEST-LLC/NOS
src/kernel/screen/VESA/vesa.c
<gh_stars>1-10 #include "vesa.h" #include <libk.h> #include <bios32.h> #include <ports.h> //////////////////////////////////////////////////////////////////////////////// ///////////////http://www.delorie.com/djgpp/doc/ug/graphics/vesa.html/////////// //////////////////////////////////////////////////////////////...
NHTHEBEST-LLC/NOS
src/kernel/screen/VESA/vesa.h
#ifndef VESA_H #define VESA_H #include <types.h> typedef struct VESA_INFO { unsigned char VESASignature[4] __attribute__ ((packed)); unsigned short VESAVersion __attribute__ ((packed)); unsigned long OEMStringPtr __attribute__ ((packed)); unsigned char Capabilities[4] ...
NHTHEBEST-LLC/NOS
src/kernel/system/ports.c
<reponame>NHTHEBEST-LLC/NOS #include <ports.h> uint8_t inb (uint16_t port) { uint8 rv; __asm__ __volatile__ ("inb %1, %0" : "=a" (rv) : "dN" (port)); return rv; } void outb (uint16_t port, uint8_t data) { __asm__ __volatile__ ("outb %1, %0" : : "dN" (port), "a" (data)); }
NHTHEBEST-LLC/NOS
src/kernel/screen/textmode.c
#include <screen.h> int cursorX = 0, cursorY = 0; const uint8 sw = 80,sh = 26,sd = 2; int color = 0x0F; void TM_clearLine(uint8 from,uint8 to) { uint16 i = sw * from * sd; string vidmem=(string)0xb8000; for(i;i<(sw*to*sd);i++) { vidmem[(i / 2)*2 + 1 ] = colo...
lsfxz/puma-2.14.0
ext/puma_http11/mini_ssl.c
#define RSTRING_NOT_MODIFIED 1 #include <ruby.h> #include <rubyio.h> #ifdef HAVE_OPENSSL_BIO_H #include <openssl/bio.h> #include <openssl/ssl.h> #include <openssl/dh.h> #include <openssl/err.h> #include <openssl/x509.h> typedef struct { BIO* read; BIO* write; SSL* ssl; SSL_CTX* ctx; } ms_conn; typedef stru...
cripplet/exceptionpp
include/src/exception.h
<gh_stars>1-10 #ifndef _EXCEPTIONPP_EXCEPTION_H #define _EXCEPTIONPP_EXCEPTION_H #include <exception> #include <string> /** * the exceptions listed here MAY be called by the user in try / catch blocks */ namespace exceptionpp { class BaseError : public std::exception { public: virtual const char *what() const...
tizenorg/framework.uifw.cbhm
src/xconverter.h
<reponame>tizenorg/framework.uifw.cbhm<gh_stars>0 /* * Copyright 2012 Samsung Electronics Co., Ltd * Licensed under the Flora License, Version 1.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.tizenopensource.org/licens...
tizenorg/framework.uifw.cbhm
src/xconverter.c
/* * Copyright 2012 Samsung Electronics Co., Ltd * Licensed under the Flora License, Version 1.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.tizenopensource.org/license * Unless required by applicable law or agreed ...
tizenorg/framework.uifw.cbhm
src/storage.c
<reponame>tizenorg/framework.uifw.cbhm<gh_stars>0 /* * Copyright 2012 Samsung Electronics Co., Ltd * Licensed under the Flora License, Version 1.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.tizenopensource.org/licens...
tizenorg/framework.uifw.cbhm
src/main.c
/* * Copyright 2012 Samsung Electronics Co., Ltd * Licensed under the Flora License, Version 1.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.tizenopensource.org/license * Unless required by applicable law or agreed ...
tizenorg/framework.uifw.cbhm
src/clipdrawer.c
/* * Copyright 2012 Samsung Electronics Co., Ltd * Licensed under the Flora License, Version 1.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.tizenopensource.org/license * Unless required by applicable law or agreed ...
tizenorg/framework.uifw.cbhm
src/clipdrawer.h
/* * Copyright 2012 Samsung Electronics Co., Ltd * Licensed under the Flora License, Version 1.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.tizenopensource.org/license * Unless required by applicable law or agreed ...
tizenorg/framework.uifw.cbhm
src/xhandler.c
/* * Copyright 2012 Samsung Electronics Co., Ltd * Licensed under the Flora License, Version 1.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.tizenopensource.org/license * Unless required by applicable law or agreed ...
tizenorg/framework.uifw.cbhm
src/item_manager.h
/* * Copyright 2012 Samsung Electronics Co., Ltd * Licensed under the Flora License, Version 1.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.tizenopensource.org/license * Unless required by applicable law or agreed ...
tizenorg/framework.uifw.cbhm
src/cbhm.h
<filename>src/cbhm.h /* * Copyright 2012 Samsung Electronics Co., Ltd * Licensed under the Flora License, Version 1.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.tizenopensource.org/license * Unless required by appl...
tizenorg/framework.uifw.cbhm
src/item_manager.c
<filename>src/item_manager.c /* * Copyright 2012 Samsung Electronics Co., Ltd * Licensed under the Flora License, Version 1.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.tizenopensource.org/license * Unless required...
tizenorg/framework.uifw.cbhm
src/xhandler.h
<filename>src/xhandler.h /* * Copyright 2012 Samsung Electronics Co., Ltd * Licensed under the Flora License, Version 1.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.tizenopensource.org/license * Unless required by ...
rickystewart/haris
src/cgenc_file.h
<filename>src/cgenc_file.h #ifndef CGENC_FILE_H_ #define CGENC_FILE_H_ #include "cgen.h" CJobStatus write_file_protocol_funcs(CJob *); #endif
rickystewart/haris
src/schema.h
#ifndef SCHEMA_H_ #define SCHEMA_H_ #include <stdlib.h> #include <string.h> #include "util.h" /* schema.h contains data definitions for the in-memory representation of the given user schema. The parser consumes tokens from the input file and constructs the schema piecemeal. When the parse has completed, a sc...
rickystewart/haris
src/lex.c
#include "lex.h" static LexerStatus handle_symbol_token(Lexer *, Token *); static LexerStatus handle_string_token(Lexer *, Token *); static void handle_comment(Lexer *); /* =============================PUBLIC INTERFACE============================= */ Lexer *create_lexer(FILE *stream, char *filename) { Lexer *ret =...
rickystewart/haris
src/cgenc_util.c
<filename>src/cgenc_util.c #include "cgenc_util.h" static CJobStatus write_readint(CJob *); static CJobStatus write_readuint(CJob *); static CJobStatus write_writeint(CJob *); static CJobStatus write_writeuint(CJob *); static CJobStatus write_readfloat(CJob *); static CJobStatus write_writefloat(CJob *); static CJobS...
rickystewart/haris
src/test/test_util.h
<gh_stars>1-10 #ifndef TEST_UTIL_H_ #define TEST_UTIL_H_ #include <stdio.h> #include <stddef.h> #include <stdlib.h> #include <string.h> /* Utilities that will prove useful in all test files. */ int buffer_equal(const unsigned char *, const unsigned char *, size_t); #endif
rickystewart/haris
src/test/test_util.c
<filename>src/test/test_util.c #include "test_util.h" int buffer_equal(const unsigned char *b1, const unsigned char *b2, size_t sz) { size_t i; for (i = 0; i < sz; i ++) { if (b1[i] != b2[i]) return 0; } return 1; }
rickystewart/haris
src/parse.c
<filename>src/parse.c #include "parse.h" /* This file contains all the functions that are pertinent to parsing. In particular, the entire recursive descent parser is hard-coded into this file. Each "state" of the parser is represented by a function; parsing functions call other functions depending on which to...
rickystewart/haris
src/hash.c
<reponame>rickystewart/haris<gh_stars>1-10 #include "hash.h" static int hash_string(char *); static int add_builtins_to_hash(TypeHash *); static TypeHashBucket *new_bucket(char *); static void add_bucket_at_index(TypeHash *, TypeHashBucket *, int); static int add_scalar_to_hash(TypeHash *, char *, ScalarTag); stati...
rickystewart/haris
src/cgenc_core.c
#include "cgenc_core.h" #include "cgenc_util.h" /* Functions relating to the public constructors, destructors, and initializers, including the algorithms for writing structures to, and reading them from, generalized streams. These functions, combined with the scalar-writing functions from cgenc_util.{ch}, pr...
rickystewart/haris
src/cgenc_file.c
#include "cgenc_file.h" static CJobStatus write_file_structures(CJob *); static CJobStatus write_static_file_funcs(CJob *); static CJobStatus write_public_file_funcs(CJob *, ParsedStruct *); /* =============================PUBLIC INTERFACE============================= */ CJobStatus write_file_protocol_funcs(CJob *jo...
rickystewart/haris
src/cgenc_fd.h
#ifndef CGENC_FD_H_ #define CGENC_FD_H_ #include "cgen.h" CJobStatus write_fd_protocol_funcs(CJob *); #endif
rickystewart/haris
src/main.c
<filename>src/main.c #include "cgen.h" #include "main.h" static void version(void); static void usage(void); static int delegate_compiler(int argc, char **argv); static int delegate_to_c(int argc, char **argv); /* Take the appropriate action given the first command-line argument: 1) If the argument is -h, call us...
rickystewart/haris
src/cgenc_buffer.h
<gh_stars>1-10 #ifndef CGENC_BUFFER_H_ #define CGENC_BUFFER_H_ #include "cgen.h" CJobStatus write_buffer_protocol_funcs(CJob *job); #endif
rickystewart/haris
src/cgenc_fd.c
<filename>src/cgenc_fd.c #include "cgenc_fd.h" static CJobStatus write_fd_structures(CJob *); static CJobStatus write_static_fd_funcs(CJob *); static CJobStatus write_public_fd_funcs(CJob *, ParsedStruct *); /* =============================PUBLIC INTERFACE============================= */ CJobStatus write_fd_protocol...
rickystewart/haris
src/cgenc_buffer.c
#include "cgenc_buffer.h" static CJobStatus write_buffer_structures(CJob *); static CJobStatus write_public_buffer_funcs(CJob *, ParsedStruct *); static CJobStatus write_static_buffer_funcs(CJob *); /* =============================PUBLIC INTERFACE============================= */ CJobStatus write_buffer_protocol_func...
rickystewart/haris
src/test/simple.c
<filename>src/test/simple.c #include "htest.h" #include "simple.haris.h" #include "test_util.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stddef.h> static int buffer_encoding_test_1(void) { unsigned char buffer[10], *out_addr, test_buffer[10] = { 0x40, 0x8, 0, 0, 0, 0, 0, 0, 0, 0 }; ...
rickystewart/haris
src/test/htest.h
<filename>src/test/htest.h #ifndef HTEST_H_ #define HTEST_H_ /* A very, very, very, VERY simple testing framework for use by the Haris test library. Here's how it works: 1) A "test" is a function of this type: int test(void); A test that returns 0 is failed; any other return value is considered ...
rickystewart/haris
src/cgenc.h
<reponame>rickystewart/haris #ifndef CGENC_H_ #define CGENC_H_ #include "cgen.h" /* This file contains procedures for writing the source code file (i.e. the .c file) of a C compilation job. In fact, this file leverages cgenc_core.c (which writes out the "core library" of functions), as well as the protocol l...
rickystewart/haris
src/util.c
<filename>src/util.c #include "util.h" /* Implementation of vasprintf from GNU/BSD */ int util_vasprintf(char **out, const char *fmt, va_list args) { char *ret; int alloc_size; va_list args_copy; va_copy(args_copy, args); alloc_size = vsnprintf((char*)NULL, 0, fmt, args); if (alloc_size >= 0) { /* alloc_si...
rickystewart/haris
src/cgenc_util.h
#ifndef CGENC_UTIL_H_ #define CGENC_UTIL_H_ #include "cgen.h" /* This file contains the tools for writing the so-called "utility library" of the generated code. The utility library is part of the "core library", and contains the functions pertinent to writing and reading scalar values to and from Haris messa...
rickystewart/haris
src/schema.c
#include "schema.h" static int field_length(ScalarTag); static int realloc_struct_scalars(ParsedStruct *); static int realloc_struct_children(ParsedStruct *); static int compute_struct_inmem_size(ParsedStruct *); static void compute_max_sizes(ParsedSchema *); static void compute_embeddability(ParsedSchema *); static...
rickystewart/haris
src/main.h
#ifndef MAIN_H_ #define MAIN_H_ #include <stdio.h> #include <stdlib.h> #include "cgen.h" #endif
rickystewart/haris
src/cgenc.c
<gh_stars>1-10 #include "cgenc.h" #include "cgenc_core.h" #include "cgenc_file.h" #include "cgenc_buffer.h" #include "cgenc_fd.h" static CJobStatus write_source_protocol_funcs(CJob *job); /* =============================PUBLIC INTERFACE============================= */ CJobStatus write_source_file(CJob *job) { CJob...
rickystewart/haris
src/cgenc_core.h
<gh_stars>1-10 #ifndef CGENC_CORE_H_ #define CGENC_CORE_H_ #include "cgen.h" /* This file contains procedures for writing the core functions of a C compilation job. In particular, this package writes the following portions of the .c file: 1) The public constructors for the structures. 2) The public d...
rickystewart/haris
src/lex.h
#ifndef LEX_H_ #define LEX_H_ #include "util.h" #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> #define BUFFER_SIZE 256 #define SYMBOL_INIT_CHAR(ch) (isalpha(ch)) #define SYMBOL_CHAR(ch) (isalpha(ch) || \ (ch == '_') || \ ...
rickystewart/haris
src/util.h
<reponame>rickystewart/haris<filename>src/util.h<gh_stars>1-10 #ifndef UTIL_H_ #define UTIL_H_ #include <string.h> #include <stdio.h> #include <stdlib.h> #include <stddef.h> #include <stdarg.h> /* Implements various helper functions (usually the stuff that I had thought mistakenly was included in the C standard, a...
rickystewart/haris
src/hash.h
<gh_stars>1-10 #ifndef HASH_H_ #define HASH_H_ #include <stdlib.h> #include <string.h> #include "schema.h" /* The hash library contains a high-level structure for mapping type names to in-memory type representations. In particular, the parser uses this structure to fetch the structure or enumeration information...
rickystewart/haris
src/parse.h
<reponame>rickystewart/haris #ifndef PARSE_H_ #define PARSE_H_ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <string.h> #include "schema.h" #include "lex.h" #include "hash.h" #define PARSER_MAX_STACK 100 typedef enum { PARSE_MEM_ERROR, PARSE_LEX_ERROR, PARSE_UNEXPECTED_TOKEN, PARSE_UNEXPEC...
rickystewart/haris
src/cgen.h
#ifndef CGEN_H_ #define CGEN_H_ #include <stdlib.h> #include <string.h> #include <stdio.h> #include <ctype.h> #include <stdarg.h> #include "schema.h" #define CJOB_FPRINTF(...) do { if (fprintf(__VA_ARGS__) < 0) \ return CJOB_IO_ERROR; } while (0) #define CJOB_FMT_HEADER_STRING(job, .....
rickystewart/haris
src/cgenh.c
<filename>src/cgenh.c #include "cgenh.h" #include "cgen.h" static CJobStatus write_header_boilerplate(CJob *); static CJobStatus write_header_macros(CJob *); static CJobStatus write_header_structures(CJob *); static CJobStatus write_reflective_structures(CJob *); static CJobStatus write_structure_definition(CJob *, co...
rickystewart/haris
src/cgen.c
#include "cgen.h" #include "cgenh.h" #include "cgenc.h" #include "parse.h" /* C COMPILER */ static CJob *new_cjob(void); static CJobStatus run_cjob(CJob *); static void destroy_cjob(CJob *); static int allocate_string_stack(CJobStringStack *, int); static int push_string(CJobStringStack *, char *); static void usag...
rickystewart/haris
src/cgenh.h
#ifndef CGENH_H_ #define CGENH_H_ #include "cgen.h" /* This file contains procedures for writing the header file of a C compilation job. */ CJobStatus write_header_file(CJob *); #endif
thexammer/GameAIAssignment3
CrashLoyal/src/Attackable.h
<gh_stars>0 #pragma once #include <memory> #include "Point.h" class Attackable { public: virtual bool isDead() = 0; virtual int attack(int dmg) = 0; virtual std::shared_ptr<Point> getPosition() = 0; virtual float GetSize() const = 0; virtual float GetMass() const = 0; };
thexammer/GameAIAssignment3
CrashLoyal/src/GameState.h
<reponame>thexammer/GameAIAssignment3 #pragma once #include <memory> #include <vector> #include <unordered_set> class Mob; class Building; class River; #include "Waypoint.h" #include "Point.h" //Screen dimension constants const int PIXELS_PER_METER = 10; // There are 10 pixels per meter in this game const int GAME...
thexammer/GameAIAssignment3
CrashLoyal/src/Building.h
#pragma once #include "GameState.h" #include "Attackable.h" #include "Point.h" #include "Mob.h" const float KingTowerSize = 5.0f; const int KingTowerHealth = 100; const float SmallTowerSize = 3.f; const int SmallTowerHealth = 50.0f; const float KingTowerAttackRadius = 20.f; const float SmallTowerAttackRadius = 20.f...
bellebethcooper/existAPI
Classes/ExistAPI.h
// // ExistAPI.h // ExistAPI // // Created by <NAME> on 9/11/18. // Copyright © 2018 Hello Code. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for ExistAPI. FOUNDATION_EXPORT double ExistAPIVersionNumber; //! Project version string for ExistAPI. FOUNDATION_EXPORT const unsigned char ...
manolosavi/mastermind
Mastermind/ViewController.h
<filename>Mastermind/ViewController.h // // ViewController.h // Mastermind // // Created by manolo on 1/26/15. // Copyright (c) 2015 manolosavi. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController <UIAlertViewDelegate> @end
robpilgrim/rosh
shell.c
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <sys/wait.h> #include <pwd.h> #include <errno.h> #include <ctype.h> #define PS1 "> " #define bsize 1024 //GLOBALS char *args[512]; int n=0; char line[bsize]; //builtins int cd(char **args) { struct passwd *pw = getpwuid(getui...
michaeladler/aoc-2020
day25/day25.c
<gh_stars>0 #include <limits.h> #include <stdint.h> #include <stdio.h> static uint64_t transform(uint64_t subject, uint64_t loop_size) { uint64_t result = 1; for (uint64_t i = 0; i < loop_size; ++i) { result = (result * subject) % 20201227; } return result; } static uint64_t crack_key(uint64_t pub_key) { ...
michaeladler/aoc-2020
share/c/aoc_nt.c
#include <limits.h> #define __STDC_FORMAT_MACROS #include <inttypes.h> // Returns modulo inverse of a with respect to m using extended // Euclid Algorithm. Refer below post for details: // https://www.geeksforgeeks.org/multiplicative-inverse-under-modulo-m/ int64_t aoc_nt_modinv(int64_t a, int64_t m) { int64_t m0 =...