repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
8bitpsp/handy | psp/psplib/ui.c | /** PSP helper library ***************************************/
/** **/
/** ui.c **/
/** **/
/** This file contains a simple GUI rendering library **/
... |
8bitpsp/handy | psp/psplib/perf.h | /** PSP helper library ***************************************/
/** **/
/** perf.h **/
/** **/
/** This file contains declarations for performance-related **/
... |
8bitpsp/handy | pixblend.h | //
// Copyright (c) 2004 <NAME>
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from
// the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including comm... |
8bitpsp/handy | sysbase.h | <reponame>8bitpsp/handy<filename>sysbase.h<gh_stars>1-10
//
// Copyright (c) 2004 <NAME>
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from
// the use of this software.
//
// Permission is granted to anyone... |
8bitpsp/handy | psp/psplib/video.h | /** PSP helper library ***************************************/
/** **/
/** video.h **/
/** **/
/** This file contains declarations for the video rendering **/
... |
8bitpsp/handy | psp/psplib/genfont.c | /** PSP helper library ***************************************/
/** **/
/** genfont.c **/
/** **/
/** This file contains a simple font converter. It converts **/
... |
8bitpsp/handy | psp/psplib/video.c | <filename>psp/psplib/video.c
/** PSP helper library ***************************************/
/** **/
/** video.c **/
/** **/
/** This file contains the video re... |
8bitpsp/handy | System.h | <reponame>8bitpsp/handy<filename>System.h
//
// Copyright (c) 2004 <NAME>
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from
// the use of this software.
//
// Permission is granted to anyone to use this so... |
8bitpsp/handy | psp/psplib/perf.c | <gh_stars>1-10
/** PSP helper library ***************************************/
/** **/
/** perf.c **/
/** **/
/** This file contains performance-related PSP ro... |
8bitpsp/handy | Susie.h | //
// Copyright (c) 2004 <NAME>
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from
// the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including comm... |
8bitpsp/handy | psp/psplib/init.c | /** PSP helper library ***************************************/
/** **/
/** init.c **/
/** **/
/** This file contains routines for INI file loading/saving **/
... |
8bitpsp/handy | Error.h | <filename>Error.h
//
// Copyright (c) 2004 <NAME>
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from
// the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
... |
8bitpsp/handy | psp/psplib/menu.h | /** PSP helper library ***************************************/
/** **/
/** menu.h **/
/** **/
/** This file contains declarations for a generic menu **/
... |
8bitpsp/handy | psp/psplib/util.h | <filename>psp/psplib/util.h
/** PSP helper library ***************************************/
/** **/
/** util.h **/
/** **/
/** This file contains declarations ... |
8bitpsp/handy | psp/psplib/menu.c | /** PSP helper library ***************************************/
/** **/
/** menu.c **/
/** **/
/** This file contains a generic menu system **/
... |
8bitpsp/handy | psp/psplib/fileio.h | <gh_stars>1-10
/** PSP helper library ***************************************/
/** **/
/** fileio.h **/
/** **/
/** This file contains declarations for the file ... |
8bitpsp/handy | psp/langres.h | /* Common definitions */
#define RES_S_GAME_TAB "Game"
#define RES_S_SAVE_LOAD_TAB "Save/Load"
#define RES_S_CONTROL_TAB "Controls"
#define RES_S_OPTION_TAB "Options"
#define RES_S_SYSTEM_TAB "System"
#define RES_S_ABOUT_TAB "About"
#define RES_S_PRESENT_SLOT_TEXT \
"\026"PSP_CHAR_SQUARE"\020 Save\... |
8bitpsp/handy | Rom.h | <reponame>8bitpsp/handy
//
// Copyright (c) 2004 <NAME>
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from
// the use of this software.
//
// Permission is granted to anyone to use this software for any pur... |
8bitpsp/handy | psp/psplib/util.c | <reponame>8bitpsp/handy
/** PSP helper library ***************************************/
/** **/
/** util.c **/
/** **/
/** This file contains various utility r... |
8bitpsp/handy | psp/psplib/image.h | <reponame>8bitpsp/handy<gh_stars>1-10
/** PSP helper library ***************************************/
/** **/
/** image.h **/
/** **/
/** This file contains dec... |
8bitpsp/handy | psp/psplib/init.h | <reponame>8bitpsp/handy<gh_stars>1-10
/** PSP helper library ***************************************/
/** **/
/** init.h **/
/** **/
/** This file contains dec... |
8bitpsp/handy | psp/psplib/audio.h | /** PSP helper library ***************************************/
/** **/
/** audio.h **/
/** **/
/** This file contains definitions for the audio rendering ... |
wyy410/WYYSDK | Example/LPodSDKTest/LSCViewController.h | //
// LSCViewController.h
// LPodSDKTest
//
// Created by wuyy on 08/23/2018.
// Copyright (c) 2018 wuyy. All rights reserved.
//
@import UIKit;
@interface LSCViewController : UIViewController
@end
|
wyy410/WYYSDK | Example/LPodSDKTest/LSCAppDelegate.h | //
// LSCAppDelegate.h
// LPodSDKTest
//
// Created by wuyy on 08/23/2018.
// Copyright (c) 2018 wuyy. All rights reserved.
//
@import UIKit;
@interface LSCAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
Bungogood/Bedlam-Cube | src/load.c | #include <load.h>
Block orientations[MAX_ORI][5];
bool unique[MAX_ORI];
void rotate_normalise (Block* blocks, int size) {
Block min = { 9, 9, 9 };
for (int i=0; i < size; i++) {
if (blocks[i].x < min.x) min.x = blocks[i].x;
if (blocks[i].y < min.y) min.y = blocks[i].y;
if (blocks[i].z... |
Bungogood/Bedlam-Cube | src/main.c | #include <cube.h>
#include <load.h>
int main(int argc, char** argv) {
load("puzzles/pieces.txt");
init_cube();
show_cube();
show_pieces();
return 0;
} |
Bungogood/Bedlam-Cube | src/cube.c | #include <cube.h>
void init_cube() {
for (int z=0; z < 4; z++) {
for (int y=0; y < 4; y++) {
for (int x=0; x < 4; x++) {
cube[x][y][z] = EMPTY;
}
}
}
}
void place_piece(Piece* piece, int ori, Block* loc) {
for (int b=0; b < piece->size; b++) {
... |
Bungogood/Bedlam-Cube | include/cube.h | <filename>include/cube.h
#pragma once
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#define BOX_SIZE 4
#define NUM_PIECES 13
#define MAX_ORI 24
#define EMPTY -1
#define NEXT 0
#define CLOCK 1
#define ANCLK 2
typedef struct Block {
int x,y,z;
} Block;
typedef struct Piece {
int i... |
Bungogood/Bedlam-Cube | include/load.h | #pragma once
#include <cube.h>
void load (); |
seletz/JasonetteAzureMobilePlugin | JasonetteAzureMobilePlugin/Classes/AzurePluginBase.h | <filename>JasonetteAzureMobilePlugin/Classes/AzurePluginBase.h
//
// JasonettePlugin.h
// Pods
//
// Created by <NAME> on 19.11.16.
//
//
#ifndef JasonettePlugin_h
#define JasonettePlugin_h
#import <MicrosoftAzureMobile/MicrosoftAzureMobile.h>
@interface AzurePluginBase : NSObject
@property (nonatomic, retain) M... |
seletz/JasonetteAzureMobilePlugin | Example/JasonetteAzureMobilePlugin/JasonViewController.h | <reponame>seletz/JasonetteAzureMobilePlugin
//
// JasonViewController.h
// JasonetteAzureMobilePlugin
//
// Created by <NAME> on 11/19/2016.
// Copyright (c) 2016 <NAME>. All rights reserved.
//
@import UIKit;
@interface JasonViewController : UIViewController
@end
|
joshwyant/cc | cc/parser.c | <filename>cc/parser.c
#include <stdio.h>
#include "lexer.c"
DECLARE_CONTAINER(Token, Token);
extern TokenIterator *token_input;
void preprocessor(void) {
LexGenerator *lexer = LexGenerator_alloc();
while (!LexGenerator_eof(lexer)) {
Token t = Lex(lexer);
switch (t.kind) {
case TOK... |
joshwyant/cc | common/protected/array.h | #ifndef COMMON_PROTECTED_ARRAY_H__
#define COMMON_PROTECTED_ARRAY_H__
#include "../public/array.h"
#include <stdbool.h>
#include <stddef.h>
struct Array
{
size_t count;
size_t elem_size;
unsigned char data[];
};
#endif // COMMON_PROTECTED_ARRAY_H__
|
joshwyant/cc | common/map.c | #include "protected/map.h"
#include <stdlib.h>
#include <string.h>
#include "../test/stubs.h"
#include "public/assert.h"
#include "public/iterator.h"
#include "public/vector.h"
// TODO:
// - Version
bool Map_init(Map *map, KeyInfo *key_info, size_t elem_size);
void Map_cleanup(Map *map);
void _Map_swap(Map *a, Ma... |
joshwyant/cc | common/protected/stack.h | <filename>common/protected/stack.h
#ifndef COMMON_PROTECTED_STACK_H__
#define COMMON_PROTECTED_STACK_H__
#include "../public/stack.h"
#include "../public/vector.h"
#include <stdlib.h>
struct Stack
{
Vector *list;
size_t current;
size_t elem_size;
int version;
};
#endif // COMMON_PROTECTED_STACK_H__
|
joshwyant/cc | cc/cc.c | <gh_stars>0
#include "cc.h"
#include <stdio.h>
#include "../test/stubs.h"
int main(int argc, char **argv) {
init_malloc_logging();
printf("Josh's C Compiler\n");
find_leaks();
}
|
joshwyant/cc | test/common/common_tests.c | #include "common_tests.h"
#include "../macros.h"
int common_tests(void) { return vector_tests() || map_tests(); }
|
joshwyant/cc | common/protected/forward_list.h | <reponame>joshwyant/cc<filename>common/protected/forward_list.h
#ifndef COMMON_PROTECTED_FORWARD_LIST_H__
#define COMMON_PROTECTED_FORWARD_LIST_H__
#include "../public/forward_list.h"
struct ForwardList
{
size_t elem_size;
size_t count;
ForwardListNode *head;
ForwardListNode *tail;
int version;
};... |
joshwyant/cc | common/forward_list.c | #include "protected/forward_list.h"
#include <stdbool.h>
#include <stddef.h>
#include <string.h>
#include "../test/stubs.h"
#include "public/collections.h"
#include "public/assert.h"
// TODO: version
DEFINE_FORWARD_LIST(Int, int)
DEFINE_FORWARD_LIST(Long, long)
DEFINE_FORWARD_LIST(Char, char)
DEFINE_FORWARD_LIST(Fl... |
joshwyant/cc | common/public/collections.h | #ifndef COMMON_PUBLIC_COLLECTION_H__
#define COMMON_PUBLIC_COLLECTION_H__
#include "array.h"
#include "assert.h"
#include "for_each_macros.h"
#include "forward_list.h"
#include "iterator.h"
#include "list.h"
#include "map.h"
#include "priority_queue.h"
#include "queue.h"
#include "set.h"
#include "stack.h"
#include "v... |
joshwyant/cc | common/vector.c | #include "protected/vector.h"
#include <math.h>
#include <string.h>
#include "../test/stubs.h"
#include "public/collections.h"
#include "public/assert.h"
bool Vector_init(Vector *vector, size_t elem_size);
void Vector_cleanup(Vector *vector);
DEFINE_VECTOR(Int, int);
DEFINE_VECTOR(Long, long);
DEFINE_VECTOR(Char, ... |
joshwyant/cc | common/public/string.h | <reponame>joshwyant/cc
#ifndef COMMON_PUBLIC_STRING_H__
#define COMMON_PUBLIC_STRING_H__
#include "class.h"
typedef struct String String;
extern Class *StringClass;
String *String_create(char *cstr);
char *String_c_str(String *self);
size_t String_length(String *self);
void String_cat(String *self, String *b);
void... |
joshwyant/cc | common/priority_queue.c | #include "protected/priority_queue.h"
#include <string.h>
#include "../test/stubs.h"
#include "public/assert.h"
bool PriorityQueue_init(PriorityQueue *queue, RelationalKeyInfo *key_info,
size_t elem_size, PriorityQueueMode mode)
{
ASSERT(queue != NULL);
ASSERT(key_info != ... |
joshwyant/cc | common/protected/map.h | <gh_stars>0
#ifndef COMMON_PROTECTED_MAP_H__
#define COMMON_PROTECTED_MAP_H__
#include "../public/map.h"
#include <stdlib.h>
#include "../public/vector.h"
struct Map {
Vector *buckets;
KeyInfo key_info;
size_t elem_size;
size_t capacity;
size_t count;
int version;
void (*print_key)(const Map *, char*,... |
joshwyant/cc | common/public/stack.h | #ifndef COMMON_PUBLIC_STACK_H__
#define COMMON_PUBLIC_STACK_H__
#include <stdbool.h>
#include <stddef.h>
#include "iterator.h"
// A LIFO stack data structure.
typedef struct Stack Stack;
// Creates a new Stack object.
Stack *Stack_alloc(size_t elem_size);
// Gets the number of elements in the Stack
size_t Stack_co... |
joshwyant/cc | cc/lexer.c | <reponame>joshwyant/cc<filename>cc/lexer.c<gh_stars>0
#include "lexer.h"
char *make_string(CharList *list);
Token make_token(TokenKind kind, CharList *buffer);
// Iterator function. Call multiple times to get a stream of tokens.
DEFINE_GENERATOR(/* Data type: */ Token, /* Name: */ Lex,
// State variables:
char, t... |
joshwyant/cc | common/public/list.h | <gh_stars>0
#ifndef COMMON_PUBLIC_LIST_H__
#define COMMON_PUBLIC_LIST_H__
#include <stdbool.h>
#include <stddef.h>
#include "iterator.h"
typedef struct List List;
// TODO:
// - -Return node after operation-
// - ??
// - -Get iterator for nodes-
// - Get [previous,] -next node-
// - Insert -[before,] after node... |
joshwyant/cc | common/public/set.h | <reponame>joshwyant/cc
#ifndef COMMON_PUBLIC_SET_H__
#define COMMON_PUBLIC_SET_H__
#include <stdbool.h>
#include <stddef.h>
#include "iterator.h"
// A set data structure.
typedef struct Set Set;
// Creates a new Set object.
Set *Set_alloc(KeyInfo *key_info);
// Gets the number of elements in the Set
size_t Set_cou... |
joshwyant/cc | common/set.c | <reponame>joshwyant/cc
#include "protected/set.h"
#include <stdlib.h>
#include <string.h>
#include "../test/stubs.h"
#include "public/assert.h"
#include "public/iterator.h"
#include "public/vector.h"
// TODO:
// - Version
bool Set_init(Set *set, KeyInfo *key_info);
void Set_cleanup(Set *set);
void _Set_swap(Set *... |
joshwyant/cc | common/public/generator.h | #ifndef COMMON_PUBLIC_GENERATOR_H__
#define COMMON_PUBLIC_GENERATOR_H__
#include "for_each_macros.h"
#include "iterator.h"
// Derived from: https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
// Design:
// - Provide a type-safe iterator
// - Define an EOF symbol
// - Use a stateful structure, declare variab... |
joshwyant/cc | common/protected/list.h | #ifndef COMMON_PROTECTED_LIST_H__
#define COMMON_PROTECTED_LIST_H__
#include "../public/list.h"
struct List
{
size_t elem_size;
size_t count;
ListNode *head;
ListNode *tail;
int version;
};
struct ListNode
{
ListNode *prev;
ListNode *next;
unsigned char data[];
};
#endif // COMMON_PR... |
joshwyant/cc | test/test.h | #ifndef TEST_TEST_H__
#define TEST_TEST_H__
#include "stubs.h"
#include "common/common_tests.h"
#endif // TEST_TEST_H__ |
joshwyant/cc | common/public/priority_queue.h | #ifndef COMMON_PUBLIC_PRIORITY_QUEUE_H__
#define COMMON_PUBLIC_PRIORITY_QUEUE_H__
#include <stdbool.h>
#include <stddef.h>
#include "iterator.h"
// A priority queue data structure.
typedef struct PriorityQueue PriorityQueue;
typedef enum {
PQ_MODE_INVALID,
PQ_MODE_SMALLEST_FIRST,
PQ_MODE_LARGEST_FIRST,
} Prio... |
joshwyant/cc | test/common/vector_tests.h | <filename>test/common/vector_tests.h
#ifndef TEST_COMMON_VECTOR_TESTS_H__
#define TEST_COMMON_VECTOR_TESTS_H__
#include "../../common/public/vector.h"
#include "../../common/public/collections.h"
#include "../macros.h"
int vector_tests(void);
#endif // TEST_COMMON_VECTOR_TESTS_H__
|
joshwyant/cc | common/protected/queue.h | #ifndef COMMON_PROTECTED_QUEUE_H__
#define COMMON_PROTECTED_QUEUE_H__
#include <stdbool.h>
#include <stddef.h>
#include "../public/queue.h"
#include "../public/vector.h"
struct Queue
{
Vector *list;
size_t begin;
size_t current;
size_t count;
size_t elem_size;
size_t capacity; // != list->cap... |
joshwyant/cc | common/protected/set.h | #ifndef COMMON_PROTECTED_SET_H__
#define COMMON_PROTECTED_SET_H__
#include "../public/set.h"
#include <stdlib.h>
#include "../public/vector.h"
struct Set {
Vector *buckets;
KeyInfo key_info;
size_t capacity;
size_t count;
int version;
};
struct SetBucket {
Vector *items; // Holds void* items to allocat... |
joshwyant/cc | common/public/queue.h | <gh_stars>0
#ifndef COMMON_PUBLIC_QUEUE_H__
#define COMMON_PUBLIC_QUEUE_H__
#include "iterator.h"
// A FIFO queue data structure.
typedef struct Queue Queue;
// Creates a new Queue object.
Queue *Queue_alloc(size_t elem_size);
// Gets the number of elements in the Queue
size_t Queue_count(const Queue *queue);
// R... |
joshwyant/cc | common/public/for_each_macros.h | #ifndef COMMON_PUBLIC_FOR_EACH_MACROS_H__
#define COMMON_PUBLIC_FOR_EACH_MACROS_H__
#define CONCATENATE(arg1, arg2) CONCATENATE1(arg1, arg2)
#define CONCATENATE1(arg1, arg2) CONCATENATE2(arg1, arg2)
#define CONCATENATE2(arg1, arg2) arg1##arg2
// Places a pair of arguments side-by-side.
#define PAIR(a, b) a b
// ... |
joshwyant/cc | cc/preprocessor.c | <reponame>joshwyant/cc<filename>cc/preprocessor.c
#include "preprocessor.h"
|
joshwyant/cc | common/protected/priority_queue.h | #ifndef COMMON_PROTECTED_PRIORITY_QUEUE_H__
#define COMMON_PROTECTED_PRIORITY_QUEUE_H__
#include <stdbool.h>
#include <stddef.h>
#include "../public/priority_queue.h"
#include "../public/vector.h"
struct PriorityQueue
{
Vector *list;
PriorityQueueMode mode;
RelationalKeyInfo *key_info;
size_t count;
... |
joshwyant/cc | common/public/class.h | <gh_stars>0
#ifndef COMMON_PUBLIC_CLASS_H__
#define COMMON_PUBLIC_CLASS_H__
#include <stddef.h>
typedef struct Class Class;
#define DECLARE_VALUE_TYPE(name, T) \
typedef struct name name; \
extern Class *name##Class; ... |
joshwyant/cc | common/class.c | #include "protected/class.h"
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include "public/assert.h"
#include "../test/stubs.h"
#define OBJECT_MAGIC 0xDEFA0B
Class objectClass = {
sizeof(Object),
"Object",
true,
(ctor_t)Object_ctor,
(dtor_t)Object_dtor,
(cast_t)Object_cast,
... |
joshwyant/cc | common/stack.c | #include "protected/stack.h"
#include <string.h>
#include "../test/stubs.h"
#include "public/assert.h"
// TODO: Version
bool Stack_init(Stack *stack, size_t elem_size)
{
ASSERT(stack);
ASSERT(elem_size);
stack->list = NULL;
stack->current = -1;
stack->elem_size = elem_size;
return true;
}
v... |
joshwyant/cc | common/list.c | <reponame>joshwyant/cc<filename>common/list.c
#include "protected/list.h"
#include <stdbool.h>
#include <stddef.h>
#include <string.h>
#include "../test/stubs.h"
#include "public/collections.h"
#include "public/assert.h"
// TODO: version
DEFINE_LIST(Int, int)
DEFINE_LIST(Long, long)
DEFINE_LIST(Char, char)
DEFINE_L... |
joshwyant/cc | test/stubs.c | <filename>test/stubs.c
#include <assert.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include "../common/public/iterator.h"
#include "../common/public/map.h"
#ifndef TESTING
#else
Map *_malloc_log;
bool _malloc_logging = false;
char _malloc_reference[1000] = "";
#endif
char _log_indent[1000] = "";
... |
joshwyant/cc | test/common/vector_tests.c | #include "vector_tests.h"
#include <string.h>
void test_string_foreach(char **item);
void test_int_foreach(int *item);
TEST(vector_basics) {
struct test t = {1, 2};
Vector *vector = Vector_alloc(sizeof(struct test));
assert(Vector_get_data(vector) == NULL);
assert(Vector_empty(vector));
assert(Vector_co... |
joshwyant/cc | test/test.c | #include "test.h"
#include "stubs.h"
#ifdef TESTING
int main(int argc, char **argv) {
init_malloc_logging();
int result = common_tests() || test_find_leaks();
printf("All tests completed.\n");
return result;
}
#endif |
joshwyant/cc | cc/lexer.h | <gh_stars>0
#ifndef CC_LEXER_H__
#define CC_LEXER_H__
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "../common/public/generator.h"
#include "../common/public/list.h"
enum TokenKind {
TOKEN_NONE,
TOKEN_EOF,
TOKEN_IDENTIFIER,
TOKEN_NUMBER,
};
typedef enum TokenKind TokenKind;
ex... |
joshwyant/cc | common/protected/string.h | #ifndef COMMON_PROTECTED_STRING_H__
#define COMMON_PROTECTED_STRING_H__
#include "../public/class.h"
#include "class.h"
#include <stdarg.h>
#include <stddef.h>
#define SHORT_STRING_SIZE 20
struct String
{
struct Object base;
char *ref;
char short_string[SHORT_STRING_SIZE];
};
void String_ctor(String *... |
joshwyant/cc | common/public/assert.h | <gh_stars>0
#ifndef COMMON_PUBLIC_ASSERT_H__
#define COMMON_PUBLIC_ASSERT_H__
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#ifndef NDEBUG
#define ASSERT(condition) assert(condition)
#else
#define ASSERT(condition) \
do { ... |
joshwyant/cc | common/public/forward_list.h | <filename>common/public/forward_list.h
#ifndef COMMON_PUBLIC_FORWARD_LIST_H__
#define COMMON_PUBLIC_FORWARD_LIST_H__
#include <stdbool.h>
#include <stddef.h>
#include "iterator.h"
typedef struct ForwardList ForwardList;
// TODO:
// - -Return node after operation-
// - ??
// - -Get iterator for nodes-
// - Get [... |
joshwyant/cc | test/stubs.h | #ifndef TEST_STUBS_H__
#define TEST_STUBS_H__
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
enum {
TRACE,
DEBUG,
INFO,
WARN,
ERROR,
FATAL,
};
extern char _log_indent[];
#define LOGARGS(level, format) \
"%-5s %4... |
joshwyant/cc | common/string.c | #include "protected/string.h"
#include "public/assert.h"
#include "../test/stubs.h"
Class stringClass = {
sizeof(String),
"String",
true,
(ctor_t)String_ctor,
(dtor_t)String_dtor,
(cast_t)String_cast,
(implements_t)String_implements,
(clone_t)String_clone,
}, *StringClass = &stringClas... |
joshwyant/cc | common/array.c | <reponame>joshwyant/cc<gh_stars>0
#include "protected/array.h"
#include <string.h>
#include "../test/stubs.h"
#include "public/collections.h"
#include "public/assert.h"
DEFINE_ARRAY(Int, int)
DEFINE_ARRAY(Long, long)
DEFINE_ARRAY(Char, char)
DEFINE_ARRAY(Float, float)
DEFINE_ARRAY(Double, double)
DEFINE_ARRAY(Unsign... |
joshwyant/cc | test/common/map_tests.h | <filename>test/common/map_tests.h
#ifndef TEST_COMMON_MAP_TESTS_H__
#define TEST_COMMON_MAP_TESTS_H__
#include "../../common/public/map.h"
#include "../macros.h"
int map_tests(void);
#endif // TEST_COMMON_MAP_TESTS_H__
|
joshwyant/cc | common/public/map.h | <reponame>joshwyant/cc<gh_stars>0
#ifndef COMMON_PUBLIC_MAP_H__
#define COMMON_PUBLIC_MAP_H__
#include <stdbool.h>
#include <stddef.h>
#include "iterator.h"
// A map data structure.
typedef struct Map Map;
// Creates a new Map object.
Map *Map_alloc(KeyInfo *key_info, size_t elem_size);
// Gets the number of eleme... |
joshwyant/cc | test/common/common_tests.h | #ifndef TEST_COMMON_COMMON_TESTS_H__
#define TEST_COMMON_COMMON_TESTS_H__
#include "vector_tests.h"
#include "map_tests.h"
int common_tests(void);
#endif // TEST_COMMON_COMMON_TESTS_H__
|
joshwyant/cc | cc/cc.h | <filename>cc/cc.h
#ifndef CC_CC_H__
#define CC_CC_H__
#endif // CC_CC_H__
|
joshwyant/cc | common/public/vector.h | <gh_stars>0
#ifndef COMMON_PUBLIC_VECTOR_H__
#define COMMON_PUBLIC_VECTOR_H__
#include <stdbool.h>
#include <stddef.h>
#include "iterator.h"
// A dynamically growing vector.
typedef struct Vector Vector;
// Creates a new Vector object.
Vector *Vector_alloc(size_t elem_size);
// Gets the number of elements in the V... |
joshwyant/cc | common/iterator.c | #include "public/iterator.h"
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "public/array.h"
#include "public/list.h"
#include "public/forward_list.h"
#include "public/map.h"
#include "public/priority_queue.h"
#include "public/queue.h"
#include "public/set.h"
#include "public/stack.h"
#include "p... |
joshwyant/cc | common/protected/class.h | #ifndef COMMON_PROTECTED_CLASS_H__
#define COMMON_PROTECTED_CLASS_H__
#include "../public/class.h"
#include <stdarg.h>
#include <stddef.h>
typedef void (*ctor_t)(void *self, va_list argp);
typedef void (*dtor_t)(void *self);
typedef void *(*cast_t)(void *self, Class *to);
typedef bool (*implements_t)(Class *c);
type... |
joshwyant/cc | common/public/iterator.h | <reponame>joshwyant/cc<filename>common/public/iterator.h
#ifndef COMMON_PUBLIC_ITERATOR_H__
#define COMMON_PUBLIC_ITERATOR_H__
#include <stdbool.h>
#include <stddef.h>
#include "assert.h"
typedef enum {
COLLECTION_NONE,
COLLECTION_ARRAY = 1 << 0,
COLLECTION_VECTOR = 1 << 1,
COLLECTION_LIST = 1 << 2,
COLLEC... |
joshwyant/cc | cc/preprocessor.h | #ifndef CC_PREPROCESSOR_H__
#define CC_PREPROCESSOR_H__
#endif // CC_PREPROCESSOR_H__
|
joshwyant/cc | common/public/array.h | <filename>common/public/array.h
#ifndef COMMON_PUBLIC_ARRAY_H__
#define COMMON_PUBLIC_ARRAY_H__
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include "iterator.h"
typedef struct Array Array;
Array *Array_alloc(size_t count, size_t elem_size);
// Re-zeroes out the memory of the used array.
void Arra... |
joshwyant/cc | test/common/map_tests.c | #include "map_tests.h"
TEST(map_basics) {
struct test t = {1, 2};
Map *m;
int one = 1, two = 2, three = 3;
char *a = "a", *b = "b", *c = "c";
m = Map_alloc(&CStringKeyInfo, sizeof(int));
Map_add(m, &a, &one);
Map_add(m, &b, &two);
Map_add(m, &c, &three);
assert(Map_count(m) == 3);
int val1, val2... |
joshwyant/cc | common/queue.c | #include "protected/queue.h"
#include <string.h>
#include "../test/stubs.h"
#include "public/collections.h"
#include "public/assert.h"
bool Queue_init(Queue *queue, size_t elem_size);
void Queue_cleanup(Queue *queue);
// TODO: Version
Queue *Queue_alloc(size_t elem_size)
{
ASSERT(elem_size > 0);
Queue *q... |
joshwyant/cc | common/protected/vector.h | <reponame>joshwyant/cc<gh_stars>0
#ifndef COMMON_PROTECTED_VECTOR_H__
#define COMMON_PROTECTED_VECTOR_H__
#include "../public/vector.h"
#include <stdlib.h>
struct Vector {
void *data;
// sizeof(data)
size_t data_size;
// sizeof(element)
size_t elem_size;
// The actual number of elements.
size_t elem... |
robbowz/SovCoinR | src/secp256k1/src/java/org_sov_NativeSecp256k1.h | /* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_sov_NativeSecp256k1 */
#ifndef _Included_org_sov_NativeSecp256k1
#define _Included_org_sov_NativeSecp256k1
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: org_sov_NativeSecp256k1
* Method: secp256k1_ecdsa_verify
... |
langthom/data-structures | AVLTree/C/node.c | <gh_stars>0
/* Copyright (c) 2015, <NAME>. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
... |
langthom/data-structures | BinarySearchTrees/C/binary_search_tree.h | /* Binary search tree.
* (C) <NAME>, 2014
*
* This header contains structs representing
* a Node of a tree and the tree itself.
* Furthermore it contains several methods
* and functions like adding a new element.
*
* This code is licensed under the BSD3 license.
*/
#ifndef binary_search_tree_h___
#define bina... |
langthom/data-structures | BinarySearchTrees/C/binary_search_tree.c | <gh_stars>0
// binary_search_tree.c - implementation of a binary search tree with integers
#include <stdio.h>
#include <stdlib.h>
#include "binary_search_tree.h"
//---------------------------------------------------------------------
/* Creating a new node that holds a passed integer value.
*
* @param element ... |
langthom/data-structures | Queue/C/queue.c | <gh_stars>0
/* Implementation of function in "queue.h"
* (C) <NAME>, 2014
*
* This module implements all functions
* that are declared in the header "queue.h".
*
* This code is licensed under the BSD3 license.
*/
#include <stdlib.h>
#include "queue.h"
//-----------------------------------------------
Queue ... |
langthom/data-structures | Heaps/minHeap/C++/min_heap.h | /* Implementation of a MinHeap.
* (C) <NAME>, 2014
*
* This header implements a specialization of the
* abstract Heap, the MinHeap.
* This is just like the abstract one, but it follows
* the rule that a node is always smaller than its
* children. Because of that, the root of this Heap
* is always the global m... |
langthom/data-structures | BTree/C++/BTree.h | <reponame>langthom/data-structures<gh_stars>0
/* Copyright (c) 2015, <NAME>. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (a... |
langthom/data-structures | Queue/C++/queue.h | <reponame>langthom/data-structures<filename>Queue/C++/queue.h
/* Implementation of a Queue.
* (C) <NAME>, 2014
*
* This header implements a generic Queue.
* A Queue is basically a List that supports
* the operations "enqueue" (adding an element),
* and "dequeue" (removing an element), but
* with the rule that if... |
langthom/data-structures | Lists/DoubleLinkedList/C/main.c | /* Testing module.
* (C) 2014, <NAME>
*
* This module does some testing on a double-linked lists.
* It will add some values, prints the list and lastly
* frees the entire list.
*
* This code is licensed under the BSD3 license.
*/
#include <stdio.h>
#include <stdlib.h>
#include "double_linked_list.h"
int main... |
langthom/data-structures | RedBlackTree/C/main.c | <reponame>langthom/data-structures
/* Copyright (c) 2015, <NAME>. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your opti... |
langthom/data-structures | RedBlackTree/C/node.h | <filename>RedBlackTree/C/node.h
/* Copyright (c) 2015, <NAME>. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option)... |
langthom/data-structures | Lists/DoubleLinkedList/C++/double_linked_list.h | /* Double linked list header.
* (C) <NAME>, 2014
*
* This header stores an implementation of a typical
* double linked list. This means there are two classes:
* * Node
* * List
*
* This code is licensed under the BSD3 license.
*/
#ifndef double_linked_list_h___
#define double_linked_list_h___
#in... |
langthom/data-structures | Stack/C/stack.h | <filename>Stack/C/stack.h<gh_stars>0
/* Stack
* (C) <NAME>, 2014
*
* This header implements a typical Stack.
* A Stack is a data structure that allows
* access only to the top element, the
* stack pointer.
*
* This code is licensed under the BSD3 license.
*/
#ifndef stack_h___
#define stack_h___
/* Struct ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.