repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
depp/raycast | src/level.c | #include "level.h"
#include "defs.h"
#include "imath.h"
#include "draw.h"
#include "texture.h"
#include <stdlib.h>
#include <assert.h>
struct rc_column {
short dx, dy;
short ax, ay;
};
/* Setup columns for perspective projection. The number of columns is
"w". The camera points in the direction specified ... |
depp/raycast | src/draw_rect.c | #include "defs.h"
#include "draw.h"
void draw_rect(struct pixbuf *restrict buf,
int x, int y, int w, int h, unsigned color)
{
unsigned *vp = buf->ptr;
unsigned vr = buf->row, vw = buf->width, vh = buf->height;
int x0 = x, x1 = x0 + w, y1 = vh - 1 - y, y0 = y1 - h, xi, yi;
if (y0 < 0) y0 ... |
depp/raycast | src/main.c | #include "SDL.h"
#include "defs.h"
#include "draw.h"
#include "input.h"
#include "level.h"
#include "text.h"
#include "texture.h"
#include "world.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
struct texture *g_textures[3];
#define TIME 5
/* Units / tick */
#define TURN 4000
/* Units / tick */
#define FO... |
depp/raycast | src/input.c | <reponame>depp/raycast
#include "input.h"
#include <stdlib.h>
void in_axis_init(struct in_axis *a)
{
a->points = NULL;
a->pcount = 0;
a->palloc = 0;
}
void in_axis_destroy(struct in_axis *a)
{
free(a->points);
}
int in_axis_get(struct in_axis *a, int time)
{
struct in_point *p = a->points;
un... |
depp/raycast | src/texture_jpeg.c | <reponame>depp/raycast<filename>src/texture_jpeg.c
#include "imath.h"
#include "texture.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <jpeglib.h>
#define MAX_SIZE 1024
void texture_load(struct texture **tex, const char *path)
{
FILE *f;
struct jpeg_decompress_struct... |
depp/raycast | src/text.c | <reponame>depp/raycast
#include "text.h"
#include "draw.h"
#include <cairo/cairo.h>
#include <pango/pangocairo.h>
#include <string.h>
void text_draw(struct pixbuf *p, const char *text, int x, int y)
{
cairo_surface_t *cs = cairo_image_surface_create_for_data(
(void *) p->ptr, CAIRO_FORMAT_ARGB32,
p... |
depp/raycast | src/imath.h | <gh_stars>0
#ifndef IMATH_H
#define IMATH_H
/* Trig functions take angles such that 0x10000 is a full circle, so
any angle can be stored in 16 bits. They return numbers in the
range -0x4000..+0x4000. */
int isin(int x);
int icos(int x);
unsigned ilog2(unsigned x);
static inline unsigned align(unsigned sz)
{
... |
depp/raycast | src/world.c | <reponame>depp/raycast
#include "defs.h"
#include "imath.h"
#include "world.h"
#include <stdlib.h>
// #include <stdio.h>
struct world *world_new(void)
{
struct world *w = xmalloc(sizeof(*w));
struct obj *o = &w->player;
o->x0 = 0;
o->y0 = 0;
o->x1 = 0;
o->y1 = 0;
o->angle = 0;
o->speed ... |
depp/raycast | src/text.h | #ifndef TEXT_H
#define TEXT_H
struct pixbuf;
void text_draw(struct pixbuf *p, const char *text, int x, int y);
#endif
|
depp/raycast | src/input.h | <gh_stars>0
#ifndef INPUT_H
#define INPUT_H
/* An axis records input for a positional axis. It combines
positional data (as from a mouse) and velocity data (as from a
keyboard or joystick). Each event has a timestamp, and the axis
can be queried for its value at a given point in time. */
struct in_point {... |
depp/raycast | src/level.h | <gh_stars>0
struct pixbuf;
void level_draw(struct pixbuf *restrict buf,
int x, int y, unsigned angle);
|
depp/raycast | src/texture_make.c | #include "draw.h"
#include "imath.h"
#include "texture.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
void texture_make(struct texture **tex, unsigned char *ptr,
unsigned w, unsigned h, unsigned rb, unsigned flags)
{
struct texture *tp;
unsigned wb, hb, count, mcount, i, coff,... |
depp/raycast | src/world.h | <gh_stars>0
#ifndef WORLD_H
#define WORLD_H
struct obj {
int x0, y0;
int x1, y1;
int angle;
int speed, strafe;
};
struct world {
struct obj player;
};
struct world *world_new(void);
void world_delete(struct world *w);
void world_update(struct world *w);
#endif
|
depp/raycast | src/defs.h | <gh_stars>0
#ifndef DEFS_H
#define DEFS_H
#include <stddef.h>
/* Define BIG_ENDIAN, LITTLE_ENDIAN, and BYTE_ORDER. Tries to work on
as many platforms as possible. Usese the definitions from a
system-provided header file when it is available. Otherwise, uses
built-in preprocessor macros if available. As a ... |
depp/raycast | src/draw.h | <filename>src/draw.h
#ifndef DRAW_H
#define DRAW_H
/* The only acceptable video format (for now, at least) is the BGRA
pixel format, 8 bits per sample. */
#include "defs.h"
#if BYTE_ORDER == BIG_ENDIAN
enum {
RSHIFT = 8,
GSHIFT = 16,
BSHIFT = 24
};
#elif BYTE_ORDER == LITTLE_ENDIAN
enum {
RSHIFT = ... |
claireful/Flix | Pods/Target Support Files/SwipyCell/SwipyCell-umbrella.h | <gh_stars>0
#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 "SwipyCell.h"
FOUNDATION_EXPORT double SwipyCellVersionNumber;
FOUNDATION_EXPORT const unsigned char Swi... |
Keenuts/virglrenderer | src/vrend_vk.h | <reponame>Keenuts/virglrenderer
#ifndef VIRGL_VK_H
#define VIRGL_VK_H
#include <vulkan/vulkan.h>
#include "util/u_double_list.h"
/* This struct contains the state of our Vulkan module
*
* vk_instance: one instance per virglrenderer process.
* physical_devices: contiguous array of VkPhysicalDevice*.
* ... |
Keenuts/virglrenderer | src/vrend_formats.c | /**************************************************************************
*
* Copyright (C) 2014 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, in... |
Keenuts/virglrenderer | vtest/vtest_vk_objects.h | <filename>vtest/vtest_vk_objects.h
#ifndef VTEST_VK_OBJECTS
#define VTEST_VK_OBJECTS
struct payload_create_descriptor_set_layout_intro {
uint32_t handle;
uint32_t flags;
uint32_t bindingCount;
};
struct payload_create_descriptor_set_layout_pBindings {
uint32_t binding;
uint32_t descriptorType;
uint3... |
Keenuts/virglrenderer | vtest/vtest_vk_commands.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vulkan/vulkan.h>
#include "virglrenderer_vulkan.h"
#include "vtest.h"
#include "os/os_misc.h"
#include "vtest_protocol.h"
#include "vtest_vk.h"
#include "vtest_vk_commands.h"
int vtest_vk_create_command_pool(UNUSED uint32_t length_dw)
{
int res;
... |
Keenuts/virglrenderer | src/virglrenderer.h | <gh_stars>1-10
/**************************************************************************
*
* Copyright (C) 2014 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without ... |
Keenuts/virglrenderer | src/vrend_vk.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vulkan/vulkan.h>
#include "util/u_double_list.h"
#include "util/u_memory.h"
#include "vrend_vk.h"
struct vrend_vk *vulkan_state;
const char* vkresult_to_string(VkResult res)
{
switch (res)
{
#define VK2STR(Value) case Value: return #Value
... |
Keenuts/virglrenderer | vtest/vtest_vk.h | <reponame>Keenuts/virglrenderer
#ifndef VTEST_VK_H
#define VTEST_VK_H
int vtest_vk_create_device(uint32_t length_dw);
int vtest_vk_destroy_device(uint32_t length_dw);
int vtest_vk_destroy_object(uint32_t length_dw);
int vtest_vk_enumerate_devices(uint32_t length_dw);
int vtest_vk_get_device_memory_properties(uint32_t ... |
Keenuts/virglrenderer | vtest/vtest_renderer.c | /**************************************************************************
*
* Copyright (C) 2015 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, in... |
Keenuts/virglrenderer | vtest/vtest_vk_objects.c | <filename>vtest/vtest_vk_objects.c<gh_stars>1-10
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vulkan/vulkan.h>
#include "virglrenderer_vulkan.h"
#include "vtest.h"
#include "vtest_protocol.h"
#include "vtest_vk.h"
#include "vtest_vk_objects.h"
extern struct vtest_renderer renderer;
int
vtest_... |
Keenuts/virglrenderer | vtest/vtest_vk.c | <gh_stars>1-10
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vulkan/vulkan.h>
#include "virglrenderer_vulkan.h"
#include "vtest.h"
#include "os/os_misc.h"
#include "vtest_protocol.h"
#include "vtest_vk.h"
extern struct vtest_renderer renderer;
int vtest_vk_create_device(UNUSED uint32_t length_... |
Keenuts/virglrenderer | src/virglrenderer_vulkan.h | <filename>src/virglrenderer_vulkan.h
#ifndef VIRGLRENDERER_VULKAN_H
#define VIRGLRENDERER_VULKAN_H
#include "virglrenderer.h"
#include <vulkan/vulkan.h>
VIRGL_EXPORT int
virgl_vk_get_device_count(uint32_t *device_count);
VIRGL_EXPORT int
virgl_vk_get_sparse_properties(uint32_t device_handle,
... |
Keenuts/virglrenderer | src/vk_device.c | #include "virgl_vk.h"
int toto()
{
}
|
Keenuts/virglrenderer | vtest/vtest_protocol.h | /**************************************************************************
*
* Copyright (C) 2015 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, in... |
Keenuts/virglrenderer | vtest/vtest_vk_commands.h | <gh_stars>1-10
#ifndef VTEST_VK_COMMANDS
#define VTEST_VK_COMMANDS
struct payload_command_pool_create_info {
uint32_t device_handle;
uint32_t flags;
uint32_t queue_family_index;
};
struct payload_command_buffer_allocate_info {
uint32_t device_handle;
uint32_t pool_handle;
uint32_t level;
uint32_t... |
Keenuts/virglrenderer | src/virglrenderer_vulkan.c | <reponame>Keenuts/virglrenderer
#include <assert.h>
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vulkan/vulkan.h>
#include "util/u_hash_table.h"
#include "util/u_pointer.h"
#include "util/u_memory.h"
#include "vrend_vk.h"
#include "virglrenderer_vulkan.h"
/* functions used i... |
Keenuts/virglrenderer | vtest/vtest.h | /**************************************************************************
*
* Copyright (C) 2015 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, in... |
jddixon/xlutil_py | src/extsrc/cFTLogForPy.h | <reponame>jddixon/xlutil_py<filename>src/extsrc/cFTLogForPy.h
/* cFTLogForPy.h */
#ifndef _C_FT_LOG_FOR_PY_H_
#define _C_FT_LOG_FOR_PY_H_
// we need something like -I /usr/include/python2.7 on the command line
// if this isn't first, expect _POSIX_C_SOURCE redefined warnings
#include <Python.h>
/* pthread specs requ... |
jddixon/xlutil_py | src/extsrc/threading.c | <filename>src/extsrc/threading.c<gh_stars>0
/* ~/dev/py/xlutil_py/extsrc/threading.c */
#include "cFTLogForPy.h"
pthread_t writerThread;
static int writerReady = false;
static pthread_mutex_t readyLock;
static pthread_cond_t readyCond;
// local prototypes
static void* startWriter (void ... |
jddixon/xlutil_py | src/extsrc/modFunc.c | <gh_stars>0
/* ~/dev/py/xlutil_py/extfunc/modFunc.c */
#include "cFTLogForPy.h"
PyObject* init_cft_logger(PyObject* self, PyObject* args) {
// INIT GLOBALS
logNdx = -1; // 0-based current index
secondThreadStarted = false; // XXX SHOULD NOT NEED THIS
// init local variab... |
jddixon/xlutil_py | src/extsrc/cFTLogForPy.c | <filename>src/extsrc/cFTLogForPy.c<gh_stars>0
/* cFTLogForPy.c */
#include "cFTLogForPy.h"
/////////////////////////////////////////////////////////////////////
// GLOBALS
/////////////////////////////////////////////////////////////////////
int logNdx; // 0-based current index
int secondThrea... |
jddixon/xlutil_py | src/extsrc/logBufs.c | <filename>src/extsrc/logBufs.c
/* ~/dev/py/xlutil_py/extsrc/logBufs.c */
#include "cFTLogForPy.h"
// local prototypes
static cFTLogDesc_t* cLogAllocInit(const char* logDir, const char* logName);
int initLogBuffers(ndx) {
memset(logDescs[ndx]->logBufDescs, 0,
C_FT_LOG_BUF_COUNT *... |
jddixon/xlutil_py | src/extsrc/evLoop.c | /* ~/dev/py/xlutil_py/src/extsrc/evLoop.c */
#include "cFTLogForPy.h"
// DATA /////////////////////////////////////////////////////////////
// EVENT LOOP /////////////////////////////////////////////
struct ev_loop* loop;
// CALLBACKS ////////////////////////////////////////////////////////
/**
* Expect to enter ... |
uybv/Adafruit_nRF52_Bootloader | src/usb/uf2/ghostfat.c | <reponame>uybv/Adafruit_nRF52_Bootloader<filename>src/usb/uf2/ghostfat.c
/*
* The MIT License (MIT)
*
* Copyright (c) Microsoft Corporation
* Copyright (c) 2020 <NAME> for Adafruit Industries
* Copyright (c) 2020 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this s... |
tipsyTentacle/blockStuck | src/CWindow.h | #include <iostream>
#include <vector>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include "RES_PATH.h"
#include "tetrisGame.h"
//#include "CLEAN_UP.h"
#ifndef __APP_WINDOW_H__
#define __APP_WINDOW_H__
const int SCREEN_X_TOP = 0;
const int SCREEN_Y_TOP = 0;
const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT ... |
tipsyTentacle/blockStuck | src/tetrisGame.h | #include <iostream>
#include <vector>
#include <random>
#include <map>
#include <utility>
#ifndef __TETRIS_GAME_H__
#define __TETRIS_GAME_H__
const int CGridHeight = 22;
const int CGridLength = 10;
const int CRotationAmount = 90;
enum colour {CYAN, YELLOW, PURPLE, GREEN, RED, BLUE, ORANGE, DEBUG};
enum status {ERROR,... |
tipsyTentacle/blockStuck | src/RES_PATH.h | <reponame>tipsyTentacle/blockStuck<filename>src/RES_PATH.h
#ifndef __RES_PATH_H__
#define __RES_PATH_H__
#include <iostream>
#include <SDL2/SDL.h>
std::string getResourcePath(const std::string &subDir = "");
#endif
|
jaeh/node-zopfli | src/png/zopflipng.h | #include "napi.h"
#ifndef NODE_ZOPFLI_PNG_H_
#define NODE_ZOPFLI_PNG_H_
Napi::Value PNGDeflate(const Napi::CallbackInfo& info);
#endif
|
CMingTseng/Cube_Assistant | app/src/main/cpp/cubex.h | <filename>app/src/main/cpp/cubex.h
/*
* cubex.h
* Cubex by <NAME> (c) 2003
* Cube Puzzle and Universal Solver.
* Notes: readme.txt Email: <EMAIL>
* NOTE: This program is unaffiliated with the Rubik's Cube Trademark.
* This program MAY NOT be reproduced or modified outside the licensing terms
* set forth in the ... |
CMingTseng/Cube_Assistant | app/src/main/cpp/colordecoder.c | #include <stdlib.h>
#include <jni.h>
#include <android/bitmap.h>
#include <android/log.h>
#define MIN(a,b) ((a)>(b)?(b):(a))
#define MAX(a,b) ((a)<(b)?(b):(a))
#define LOG_TAG "libcolordecoder"
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
// com.droidtools.rubiksolver.ColorDecod... |
oceaquaris/biomics | genomics/tools/TASSEL5hmp2numhmp.c | /**
* @file TASSEL5hmp2numhmp.c
* @version 0.1
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static int file_exists(const char *filename);
static int cpyline(FILE *src, FILE *dest, int *exitstate);
static int cpycol(FILE *src, FILE *dest, int *exitstate);
static int parsealleles(FILE *src, FILE *de... |
rod-lin/c0re | kernel/mem/smfifo.h | #ifndef _KERNEL_MEM_SMFIFO_H_
#define _KERNEL_MEM_SMFIFO_H_
/* swap manager using FIFO */
#include "mem/swap.h"
extern swap_manager_t swap_manager_fifo;
#endif
|
rod-lin/c0re | kernel/fs/swapfs.h | <reponame>rod-lin/c0re<filename>kernel/fs/swapfs.h<gh_stars>1-10
#ifndef _KERNEL_FS_SWAPFS_H_
#define _KERNEL_FS_SWAPFS_H_
#include "mem/mmu.h"
#include "mem/swap.h"
// return max swap offset
size_t swapfs_init();
int swapfs_read(swap_entry_t entry, page_t *page);
int swapfs_write(swap_entry_t entry, page_t *page);
... |
rod-lin/c0re | kernel/lib/debug.c | <gh_stars>1-10
#include "pub/x86.h"
#include "lib/io.h"
#include "lib/debug.h"
void _panic(char *file, int line, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
kprintf("c0re panicked at %s: line %d: ", file, line);
vkprintf(fmt, ap);
kputc('\n');
va_end(ap);
hlt();
}
|
rod-lin/c0re | kernel/driver/clock.c | #include "pub/x86.h"
#include "intr/trap.h"
#include "driver/pic.h"
#include "driver/clock.h"
/* *
* support for time-related hardware gadgets - the 8253 timer,
* which generates interruptes on IRQ-0.
* */
#define IO_TIMER1 0x040 // 8253 Timer #1
/* *
* Frequency of all three count-down ... |
rod-lin/c0re | kernel/intr/trap.h | <reponame>rod-lin/c0re<gh_stars>1-10
#ifndef _KERNEL_INTR_TRAP_H_
#define _KERNEL_INTR_TRAP_H_
#include "pub/com.h"
#include "pub/x86.h"
#define intr_enable() sti()
#define intr_disable() cli()
/* trap Numbers */
/* processor-defined: */
#define TRAPNO_DIVIDE 0 // divide error
#define TRAPNO_DEBUG ... |
rod-lin/c0re | kernel/intr/trap.c | <gh_stars>1-10
#include "pub/com.h"
#include "pub/x86.h"
#include "pub/string.h"
#include "lib/io.h"
#include "lib/debug.h"
#include "intr/trap.h"
#include "mem/mmu.h"
#include "mem/vmm.h"
#include "driver/console.h"
#include "driver/clock.h"
/* *
* Interrupt descriptor table:
*
* Must be built at run time becau... |
rod-lin/c0re | pub/dllist.h | #ifndef _PUB_DLLIST_H_
#define _PUB_DLLIST_H_
#include "pub/com.h"
/**
* Simple doubly linked list implementation.
*
* Some of the internal functions ("__xxx") are useful when manipulating
* whole lists rather than single entries, as sometimes we already know
* the next/prev entries and we can generate better co... |
rod-lin/c0re | kernel/fs/fs.h | <reponame>rod-lin/c0re<gh_stars>1-10
#ifndef _KERNEL_FS_FS_H_
#define _KERNEL_FS_FS_H_
#include "mem/mmu.h"
#define FS_SECTOR_SIZE 512
#define FS_PAGE_NSECTOR (PAGE_SIZE / FS_SECTOR_SIZE)
#define FS_SWAP_DEV_NO 1
#endif
|
rod-lin/c0re | kernel/mem/pmm.c | #include "pub/com.h"
#include "pub/x86.h"
#include "pub/string.h"
#include "pub/error.h"
#include "lib/sync.h"
#include "lib/debug.h"
#include "mem/mmu.h"
#include "mem/pmm.h"
#include "mem/vmm.h"
#include "mem/swap.h"
#include "mem/ffit.h"
/* *
* Task State Segment:
*
* The TSS may reside anywhere in memory. A s... |
rod-lin/c0re | kernel/driver/ide.h | <gh_stars>1-10
#ifndef _KERNEL_DRIVER_IDE_H_
#define _KERNEL_DRIVER_IDE_H_
#include "pub/com.h"
void ide_init();
bool ide_device_valid(unsigned short ideno);
size_t ide_device_size(unsigned short ideno);
int ide_read_secs(unsigned short ideno, uint32_t secno, void *dst, size_t nsecs);
int ide_write_secs(unsigned sho... |
rod-lin/c0re | kernel/lib/io.c | #include "pub/com.h"
#include "pub/stdarg.h"
#include "pub/printfmt.h"
#include "lib/io.h"
int kputns(char *str, int max)
{
int count;
for (count = 0; *str != '\0'; str++, count++) {
if (count >= max) break;
kputc(*str);
}
return count;
}
int kputs(char *str)
{
int count... |
rod-lin/c0re | kernel/mem/vmm.c | <reponame>rod-lin/c0re
#include "pub/com.h"
#include "pub/dllist.h"
#include "pub/error.h"
#include "mem/swap.h"
#include "mem/vmm.h"
#include "mem/pmm.h"
vma_t *vma_new(uintptr_t start, uintptr_t end, uint32_t flags)
{
vma_t *vma = kmalloc(sizeof(*vma));
if (vma) {
vma->start = start;
vma->e... |
rod-lin/c0re | kernel/mem/vmm.h | #ifndef _KERNEL_MEM_VMM_H_
#define _KERNEL_MEM_VMM_H_
/* virtual memory management */
#include "pub/com.h"
#include "pub/dllist.h"
#include "mem/mmu.h"
#include "lib/sync.h"
struct vma_set_t_tag;
typedef struct {
struct vma_set_t_tag *set;
uintptr_t start;
uintptr_t end;
uint32_t flags;
... |
rod-lin/c0re | kernel/mem/ffit.c | #include "pub/com.h"
#include "pub/x86.h"
#include "mem/ffit.h"
#include "mem/mmu.h"
#include "mem/pmm.h"
#include "lib/debug.h"
/* first-fit page allocator */
extern const page_allocator_t page_ffit_allocator;
/* free_area_t - maintains a doubly linked list to record free (unused) pages */
free_area_t free_area;
... |
rod-lin/c0re | pub/error.h | <reponame>rod-lin/c0re
#ifndef _PUB_ERROR_H_
#define _PUB_ERROR_H_
/* kernel error codes -- keep in sync with list in lib/printfmt.c */
#define E_UNSPECIFIED 1 // unspecified or unknown problem
#define E_BAD_PROC 2 // process doesn't exist or otherwise
#define E_INVAL 3 // invali... |
rod-lin/c0re | pub/x86.h | <reponame>rod-lin/c0re
#ifndef _PUB_X86_H_
#define _PUB_X86_H_
#include "pub/com.h"
// TODO: why do we need this?? (required in printfmt)
#define do_div(n, base) ({ \
unsigned long __upper, __low, __high, __mod, __base; \
__base = (base); ... |
rod-lin/c0re | pub/atomic.h | <gh_stars>1-10
#ifndef _PUB_ATOMIC_H_
#define _PUB_ATOMIC_H_
#include "pub/com.h"
/* Atomic operations that C can't guarantee us. Useful for resource counting etc.. */
/**
* NOTE: bt*l instructions respectively do an action on the nth bit of *(int *)addr
* btsl: set the bit
* btrl: reset the bit
* btcl: change/f... |
rod-lin/c0re | kernel/fs/swapfs.c | #include "mem/mmu.h"
#include "driver/ide.h"
#include "fs/fs.h"
#include "fs/swapfs.h"
#include "mem/swap.h"
size_t swapfs_init()
{
assert((PAGE_SIZE % FS_SECTOR_SIZE) == 0);
if (!ide_device_valid(FS_SWAP_DEV_NO)) {
trace("swap fs not available");
return 0;
}
... |
rod-lin/c0re | pub/string.h | #ifndef _PUB_STRING_H_
#define _PUB_STRING_H_
#include "pub/com.h"
size_t strlen(const char *s);
size_t strnlen(const char *s, size_t len);
char *strcpy(char *dst, const char *src);
char *strncpy(char *dst, const char *src, size_t len);
int strcmp(const char *s1, const char *s2);
int strncmp(const char *s1, const c... |
rod-lin/c0re | kernel/mem/swap.h | #ifndef _KERNEL_MEM_SWAP_H_
#define _KERNEL_MEM_SWAP_H_
#include "pub/com.h"
#include "mem/mmu.h"
#include "mem/pmm.h"
#include "mem/vmm.h"
#define SWAP_MAX_RETRY_TIME 16
typedef pte_t swap_entry_t;
typedef struct {
const char *name;
int (*init)();
int (*initVMASet)(vma_set_t *set);
int (*... |
rod-lin/c0re | kernel/lib/debug.h | <filename>kernel/lib/debug.h
#ifndef _KERNEL_LIB_DEBUG_H_
#define _KERNEL_LIB_DEBUG_H_
#include "driver/console.h"
#include "lib/io.h"
#define trace(...) \
kprintf(__VA_ARGS__); \
kputc('\n')
void _panic(char *file, int line, const char *fmt, ...);
#define panic(...) _panic(__FILE__, __LINE__, __VA_ARGS... |
rod-lin/c0re | kernel/init/init.c | <reponame>rod-lin/c0re<filename>kernel/init/init.c
#include "pub/string.h"
#include "lib/debug.h"
#include "mem/pmm.h"
#include "mem/vmm.h"
#include "mem/swap.h"
#include "intr/trap.h"
#include "driver/pic.h"
#include "driver/clock.h"
#include "driver/ide.h"
void c0re_init() {
// extern char bss_begin[], bss_en... |
rod-lin/c0re | kernel/driver/console.h | <filename>kernel/driver/console.h
#ifndef _KERNEL_DRIVER_CONSOLE_H_
#define _KERNEL_DRIVER_CONSOLE_H_
void cons_init();
void cons_putc(int c);
int cons_getc();
#endif
|
rod-lin/c0re | boot/bootasm.h | <reponame>rod-lin/c0re
#ifndef _BOOT_BOOTASM_H_
#define _BOOT_BOOTASM_H_
#include "kernel/mem/mmu.h"
#endif
|
rod-lin/c0re | pub/com.h | #ifndef _PUB_COM_H_
#define _PUB_COM_H_
#ifdef __GNUC__
#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))
#define C0RE_INLINE static __inline__ __attribute__((always_inline))
#else
#define C0RE_INLINE static __inline__
#endif
#elif defined(_MSC_VER)
#define C0RE_INLINE static __forceinline... |
rod-lin/c0re | kernel/mem/swap.c | #include "pub/com.h"
#include "lib/debug.h"
#include "fs/swapfs.h"
#include "mem/swap.h"
#include "mem/smfifo.h"
#include "mem/pmm.h"
#include "mem/vmm.h"
static size_t max_swap_offset;
size_t swap_getOffset(swap_entry_t entry)
{
size_t offset = entry >> 8;
if (!offset || offset >= max_swap_offset) {
... |
rod-lin/c0re | kernel/lib/io.h | #ifndef _KERNEL_LIB_IO_H_
#define _KERNEL_LIB_IO_H_
#include "pub/stdarg.h"
#include "driver/console.h"
#define kputc cons_putc
int kputns(char *str, int max);
int kputs(char *str);
int vkprintf(const char *fmt, va_list ap);
int kprintf(const char *fmt, ...);
#endif
|
rod-lin/c0re | kernel/mem/pmm.h | <reponame>rod-lin/c0re<gh_stars>1-10
#ifndef _KERNEL_MEM_PMM_H_
#define _KERNEL_MEM_PMM_H_
#include "pub/com.h"
#include "lib/debug.h"
#include "mem/mmu.h"
typedef struct {
const char *name;
void (*init)(void); // init
void (*addMem)(page_t *, size_t); // add new mem block
page_t *(*alloc)(siz... |
rod-lin/c0re | tool/sign.c | // format bootloader sector
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
#define err(...) \
fprintf(stderr, "sign error: "); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n");
#define trace(...) \
fprintf(stderr, "sign: "); \
... |
rod-lin/c0re | kernel/mem/smfifo.c | #include "pub/com.h"
#include "pub/dllist.h"
#include "lib/debug.h"
#include "mem/smfifo.h"
static dllist_t fifo_head;
static int smfifo_init()
{
return 0;
}
static int smfifo_initVMASet(vma_set_t *set)
{
dllist_init(&fifo_head);
set->swap_data = &fifo_head;
trace("smfifo: init fifo_head %p", ... |
rod-lin/c0re | kernel/lib/sync.h | #ifndef _KERNEL_LIB_SYNC_H_
#define _KERNEL_LIB_SYNC_H_
#include "pub/com.h"
#include "pub/x86.h"
#include "intr/trap.h"
#include "mem/mmu.h"
C0RE_INLINE bool _intr_save()
{
if (read_eflags() & EFLAG_IF) {
intr_disable();
return 1;
}
return 0;
}
C0RE_INLINE void _intr_restore(bool f... |
rod-lin/c0re | kernel/driver/pic.h | #ifndef _KERNEL_DRIVER_PIC_H_
#define _KERNEL_DRIVER_PIC_H_
void pic_init();
void pic_enable(unsigned int irq);
#endif
|
rod-lin/c0re | pub/printfmt.h | #ifndef _PUB_PRINTFMT_H_
#define _PUB_PRINTFMT_H_
#include "pub/com.h"
#include "pub/stdarg.h"
/* print format */
typedef void (*putc_fn_t)(int, void*);
void printfmt(putc_fn_t putch, void *putdat, const char *fmt, ...);
void vprintfmt(putc_fn_t putch, void *putdat, const char *fmt, va_list ap);
int snprintf(char *... |
rod-lin/c0re | kernel/driver/clock.h | #ifndef _KERNEL_DRIVER_CLOCK_H_
#define _KERNEL_DRIVER_CLOCK_H_
#include "pub/com.h"
#define CLOCK_TICK_PER_SEC 100
void clock_init();
long clock_tick();
// used only in trap.c
void _clock_inc();
#endif
|
rod-lin/c0re | kernel/mem/mmu.h | #ifndef _KERNEL_MEM_MMU_H_
#define _KERNEL_MEM_MMU_H_
/* memory management unit */
/* mem layout */
/* global segment numbers */
#define GDT_SEGNO_KTEXT 1 // K for kernel
#define GDT_SEGNO_KDATA 2
#define GDT_SEGNO_UTEXT 3
#define GDT_SEGNO_UDATA 4
#define GDT_SEGNO_TSS 5
/* global descriptor numbe... |
rod-lin/c0re | kernel/mem/ffit.h | <reponame>rod-lin/c0re<gh_stars>1-10
#ifndef _KERNEL_MEM_FFIT_H_
#define _KERNEL_MEM_FFIT_H_
/* first-fit page allocation */
#include "mem/pmm.h"
extern const page_allocator_t page_ffit_allocator;
#endif
|
kbladin/shading_tests | include/SettingsManager.h | #ifndef SETTINGSMANAGER_H
#define SETTINGSMANAGER_H
#ifndef Q_MOC_RUN
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/ext.hpp>
#endif
class SettingsManager
{
public:
static SettingsManager* Instance();
const int N_LIGHTSOURCES;
const int FILENAME_SIZE;
int n_blur_loops;
int filter_size;
float mu... |
kbladin/shading_tests | include/RenderTexture.h | #ifndef RENDER_TEXTURE_H
#define RENDER_TEXTURE_H
#include "GL/glew.h"
#include "GL/glfw3.h"
class RenderTexture
{
public:
RenderTexture(int width, int height);
~RenderTexture(){};
GLuint GetFrameBuffer();
int GetWidth();
int GetHeight();
GLuint frame_buffer_;
GLuint rendered_texture_; // Might be moved ... |
kbladin/shading_tests | include/ShaderTests.h | <filename>include/ShaderTests.h
#ifndef SHADER_TESTS_H
#define SHADER_TESTS_H value
#include "../include/Scene.h"
#include "../include/MyGlWindow.h"
class ShaderTests
{
public:
ShaderTests();
~ShaderTests();
private:
MyGlWindow* my_gl_window_;
};
#endif |
kbladin/shading_tests | include/kalles_gl_lib/Camera.h | #ifndef CAMERA_H
#define CAMERA_H
// External
#ifndef Q_MOC_RUN
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/ext.hpp>
#endif
//! The camera class is used to obtain the view and projection matrices.
class Camera {
public:
Camera(glm::vec3 target, float far_clipping, float near_clipping, float aspec... |
kbladin/shading_tests | include/MyMesh.h | <reponame>kbladin/shading_tests
#ifndef MY_MESH_H
#define MY_MESH_H
#include "../include/kalles_gl_lib/Mesh.h"
class MyMesh : public Mesh
{
public:
MyMesh(const char* file_path);
~MyMesh(){};
glm::mat4 GetModelTransform();
void Render();
bool IsCorrupt(){ return corrupt_; };
glm::vec3 position_;
glm... |
kbladin/shading_tests | include/MyShaderManager.h | <gh_stars>0
#ifndef MY_SHADER_MANAGER_H
#define MY_SHADER_MANAGER_H
#include "kalles_gl_lib/ShaderManager.h"
class MyShaderManager : public ShaderManager
{
public:
static MyShaderManager* Instance();
static void CreateInstance();
private:
MyShaderManager();
void AddAllShaders();
void AddAllShaderPrograms()... |
kbladin/shading_tests | include/Scene.h | #ifndef SCENE_H
#define SCENE_H
#include <vector>
#include "../include/kalles_gl_lib/Camera.h"
#include "../include/kalles_gl_lib/Mesh.h"
#include "../include/MyMesh.h"
#include "../include/RenderTexture.h"
#include "../include/Quad.h"
struct AmbientLight {
float intensity;
glm::vec3 color;
AmbientLight(){
... |
kbladin/shading_tests | include/Quad.h | <reponame>kbladin/shading_tests
#ifndef QUAD_H
#define QUAD_H
#include "../include/kalles_gl_lib/Mesh.h"
class Quad : public Mesh
{
public:
Quad();
~Quad(){};
void Render();
private:
void SetupVertexData();
void SetupBuffers();
};
#endif |
kbladin/shading_tests | include/kalles_gl_lib/MeshLoader.h | <filename>include/kalles_gl_lib/MeshLoader.h
#ifndef MESH_LOADER_H
#define MESH_LOADER_H
#include <assimp/Importer.hpp> // C++ importer interface
#include <assimp/scene.h> // Output data structure
#include <assimp/postprocess.h> // Post processing flags
#ifndef Q_MOC_RUN
#define GLM_FORCE_RADIANS
#i... |
kbladin/shading_tests | include/MyGlWindow.h | <gh_stars>0
#ifndef MY_GL_WINDOW_H
#define MY_GL_WINDOW_H
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <AntTweakBar.h>
#include "../include/Scene.h"
class MyGlWindow
{
public:
MyGlWindow();
~MyGlWindow();
void MainLoop();
private:
int InitGLFW();
int InitOpenGL();
int InitTW();
void RenderScene(... |
kbladin/shading_tests | include/kalles_gl_lib/Mesh.h | #ifndef MESH_H
#define MESH_H
#include <vector>
// External
#ifndef Q_MOC_RUN
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/ext.hpp>
#endif
#include "GL/glew.h"
#include "GL/glfw3.h"
#include "../../include/kalles_gl_lib/Camera.h"
class Mesh
{
friend class Renderer;
public:
Mesh();
virtual ~Mes... |
mamoniem/bellz | Source/Bellz/GameDataTables.h | <filename>Source/Bellz/GameDataTables.h
// All rights reserved, <NAME> 2016 http://www.mamoniem.com/
#pragma once
#include "Engine/DataTable.h"
#include "GameFramework/Actor.h"
#include "GameDataTables.generated.h"
USTRUCT(Blueprintable)
struct FWeaponStruct : public FTableRowBase
{
GENERATED_USTRUCT_BODY()
public:... |
mamoniem/bellz | Source/Bellz/CoinPickup.h | // All rights reserved, <NAME> 2016 http:
#pragma once
#include "PickupBase.h"
#include "CoinPickup.generated.h"
/**
*
*/
UCLASS()
class BELLZ_API ACoinPickup : public APickupBase
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
ACoinPickup();
// The Override for the Virtual of... |
mamoniem/bellz | Source/Bellz/Enemy.h | <filename>Source/Bellz/Enemy.h
// All rights reserved, <NAME> 2016 http://www.mamoniem.com/
#pragma once
#include "GameFramework/Character.h"
#include "Enemy.generated.h"
UCLASS()
class BELLZ_API AEnemy : public ACharacter
{
GENERATED_BODY()
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Triggers, meta ... |
mamoniem/bellz | Source/Bellz/PickupBase.h | <reponame>mamoniem/bellz
// All rights reserved, <NAME> 2016 http:
#pragma once
#include "GameFramework/Actor.h"
#include "PickupBase.generated.h"
UCLASS()
class BELLZ_API APickupBase : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
APickupBase();
// Called when t... |
mamoniem/bellz | Source/Bellz/EnemyAIController.h | <reponame>mamoniem/bellz<gh_stars>0
// All rights reserved, <NAME> 2016 http://www.mamoniem.com/
#pragma once
#include "AIController.h"
#include "EnemyAIController.generated.h"
/**
*
*/
UCLASS()
class BELLZ_API AEnemyAIController : public AAIController
{
GENERATED_BODY()
public:
AEnemyAIController();
UPROPE... |
mamoniem/bellz | Source/Bellz/BellzGameMode.h | <reponame>mamoniem/bellz<filename>Source/Bellz/BellzGameMode.h
// All rights reserved, <NAME> 2016 http://www.mamoniem.com/
#pragma once
#include "GameFramework/GameMode.h"
#include "BellzGameMode.generated.h"
UCLASS(minimalapi)
class ABellzGameMode : public AGameMode
{
GENERATED_BODY()
public:
ABellzGameMode();... |
mamoniem/bellz | Source/Bellz/Bellz.h | // All rights reserved, <NAME> 2016 http://www.mamoniem.com/
#ifndef __PUREGAME_H__
#define __PUREGAME_H__
//I replaced the EngineMinimal.h, in order to get access to lots of other things...Maily was to enable the on sreen debugging messages!
//#include "EngineMinimal.h"
#include "Engine.h"
#include "BellzSaveGame.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.