repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
MistEO/meojson
include/json.h
<filename>include/json.h #pragma once #include "json_parser.h" #include "json_value.h" #include "json_object.h" #include "json_array.h" #include "json_exception.h"
MistEO/meojson
include/json_array.h
#pragma once #include <string> #include <vector> #include <initializer_list> namespace json { class value; class array { public: using raw_array = std::vector<value>; using iterator = raw_array::iterator; using const_iterator = raw_array::const_iterator; using reverse_...
MistEO/meojson
include/json_object.h
#pragma once #include <string> #include <unordered_map> #include <initializer_list> #include "json_value.h" namespace json { class object { public: using raw_object = std::unordered_map<std::string, value>; using iterator = raw_object::iterator; using const_iterator = raw_object::const_iterator; object()...
MistEO/meojson
include/json_aux.h
<filename>include/json_aux.h #pragma once #include <string> #include "json_value.h" namespace json { static std::string unescape_string(std::string&& str) { std::string replace_str; std::string escape_str = std::move(str); for (size_t pos = 0; pos < escape_str.size(); ++pos) {...
MistEO/meojson
include/json_value.h
<reponame>MistEO/meojson<filename>include/json_value.h<gh_stars>10-100 #pragma once #include <string> #include <ostream> // #include <iostream> #include <memory> namespace json { enum class value_type : char { Invalid, Null, Boolean, String, Number, Array, ...
MistEO/meojson
include/json_parser.h
<filename>include/json_parser.h #pragma once #include <string> #include <optional> namespace json { class value; class object; class array; enum class value_type : char; class parser { public: ~parser() noexcept = default; static std::optional<value> parse(const std::stri...
PucklaMotzer09/3DEngine
include/Vertex3D.h
#ifndef VERTEX_H #define VERTEX_H #include "OBJLoader.h" #include "Vector2.h" #include "Vector3.h" #include <GL/glew.h> namespace Johnny { /*! \brief A class which stores Vertex data for a 3D mesh * */ class Vertex3D { public: Vertex3D(); ~Vertex3D(); static const int SIZE; //!< The size of th...
PucklaMotzer09/3DEngine
include/Vector3.h
#pragma once #include "Vector4.h" #include <GL/glew.h> #include <cmath> #include <iostream> namespace Johnny { template <class T> class Vector3; template <class T> Vector3<T> operator+(const Vector3<T> &, const Vector3<T> &); template <class T> Vector3<T> operator-(const Vector3<T> &, const Vector3<T> &); te...
PucklaMotzer09/3DEngine
include/RenderUtil.h
<reponame>PucklaMotzer09/3DEngine<filename>include/RenderUtil.h #pragma once #include <SDL2/SDL.h> #include <string> #define ERROR_OUT(func, errorText) \ if (func < 0) \ Johnny::LogManager::error( ...
PucklaMotzer09/3DEngine
include/CubeMap3D.h
#pragma once #include "../include/Texture.h" #include <string> namespace Johnny { class ResourceManager; class TextureData; /*! \brief This is a CubeMapTexture * */ class CubeMap3D : public Texture { public: /*! \brief Creates a new CubeMap3D from files * \param top The filepath of the texture us...
PucklaMotzer09/3DEngine
include/Matrix3.h
#pragma once #include "../include/Matrix4.h" #include "../include/Vector2.h" #include "../include/Vector3.h" #include "../include/mathematics_functions.h" #include <GL/glew.h> #include <iostream> #include <string> #define MAT3_GET(r, c) (r + c * 3) namespace Johnny { template <class T> class Matrix3; tem...
PucklaMotzer09/3DEngine
include/PhysicsSprite2D.h
<reponame>PucklaMotzer09/3DEngine #ifndef PHYSICS_SPRITE_H #define PHYSICS_SPRITE_H #include "../include/Sprite2D.h" #include <box2d/box2d.h> namespace Johnny { class Texture; /*! \brief A class which represents a b2Body as a Sprite2D * */ class PhysicsSprite2D : public Sprite2D { public: /*! \brief ...
PucklaMotzer09/3DEngine
include/JoystickListener.h
#ifndef JOYSTICKLISTENER_H #define JOYSTICKLISTENER_H #include "Events.h" #include "JoystickListenerEnums.h" #include <map> #include <vector> namespace Johnny { class JoystickListener; /*! \brief A Listener class which catches button input and axis movement of a * controller * */ class AxisButtonList...
PucklaMotzer09/3DEngine
include/Entity3D.h
<reponame>PucklaMotzer09/3DEngine<gh_stars>0 #pragma once #include "../include/Actor.h" #include "../include/Transform3D.h" #include <string> namespace Johnny { class Model3D; class Shader; class Mesh3D; /*! \brief Thes represents a model as a Actor * */ class Entity3D : public Actor, public Transforma...
PucklaMotzer09/3DEngine
include/Settings.h
<reponame>PucklaMotzer09/3DEngine<filename>include/Settings.h #pragma once #include <GL/glew.h> namespace Johnny { class MainClass; /*! \brief A enum which stores all names of the settings which can be adjusted * */ enum SettingName { VSYNC, //!< The name of the setting that specifys if vsync should be ...
PucklaMotzer09/3DEngine
include/Johnny.h
#ifndef JOHNNY_H #define JOHNNY_H #include "Actor.h" #include "Camera2D.h" #include "Camera3D.h" #include "Colors.h" #include "ContactListener.h" #include "CubeMap3D.h" #include "DebugMovement2D.h" #include "DebugMovement3D.h" #include "Defines.h" #include "Entity3D.h" #include "FrameBuffer.h" #include "...
PucklaMotzer09/3DEngine
include/Matrix4.h
<reponame>PucklaMotzer09/3DEngine #pragma once #include "../include/Vector3.h" #include "../include/Vector4.h" #include "../include/operators.h" #include <iostream> #include <string> #ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES 1 #endif #include "../include/mathematics_functions.h" #define MAT4_GET(r...
PucklaMotzer09/3DEngine
include/operators.h
#ifndef OPERATORS_H_INCLUDED #define OPERATORS_H_INCLUDED #include <string> extern const std::string operator+(const std::string &, int); extern const std::string operator+(int, const std::string &); extern const std::string operator+(const std::string &, const double &); extern const std::string operator+(cons...
PucklaMotzer09/3DEngine
include/mathematics_functions.h
#pragma once #ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES 1 #endif #include <algorithm> #include <cmath> #include <cstdlib> #include <math.h> #include <vector> namespace Johnny { /*! \brief Converts degrees into radians * \param degrees The value in degrees * \return The value in radians */ ...
PucklaMotzer09/3DEngine
include/Skybox.h
<filename>include/Skybox.h #pragma once #include "../include/Actor.h" #include "ShaderUpdater.h" #include "Vector3.h" #include <GL/glew.h> #include <string> namespace Johnny { class CubeMap3D; class Shader; /*! \brief The ShaderUpdater for the Skybox * */ class SkyboxShaderUpdater : public ShaderUpdat...
PucklaMotzer09/3DEngine
include/Window.h
#ifndef Window_H #define Window_H #include "../include/Actor.h" #include "../include/Vector2.h" #include <GL/glew.h> #include <SDL2/SDL_stdinc.h> #include <SDL2/SDL_video.h> namespace Johnny { class MainClass; class Texture; class TextureData; class Framework; /*! \brief A class which represents a windo...
PucklaMotzer09/3DEngine
include/SDLFramework.h
#ifndef SDLFRAMEWORK_H #define SDLFRAMEWORK_H #include "Events.h" #include "Framework.h" #include <SDL2/SDL.h> namespace Johnny { class SDLFramework : public Framework { public: bool init(FrameworkInitFlags flags) override; bool quit() override; bool initWindow() override; bool initGraphics() override; bool ...
PucklaMotzer09/3DEngine
include/Timer.h
<gh_stars>0 #pragma once #include <SDL2/SDL2_framerate.h> #include <chrono> #define NO_FPS_LOCK -1 using namespace std; using namespace chrono; namespace Johnny { /*! \brief A class for measuring time, smoothing the timestep and locking the * framerate * */ class Timer { public: Timer(); ~Tim...
PucklaMotzer09/3DEngine
include/Sprite2D.h
#pragma once #include "Actor.h" #include "Geometry.h" #include "Texture.h" #include "Tween.h" #include <string> namespace Johnny { class TiledMap; /*! \brief A class which represents a Texture as an Actor * */ class Sprite2D : public Actor, public TweenableObject2D { public: friend class TiledMap; ...
PucklaMotzer09/3DEngine
include/MainClass.h
<gh_stars>0 #ifndef MAINCLASS_H #define MAINCLASS_H #include "Actor.h" #include "Colors.h" #include "Events.h" #include "Framework.h" #include "InputManager.h" #include "Timer.h" #include "Vector2.h" #include "Window.h" #include <GL/glew.h> #include <SDL2/SDL2_framerate.h> #include <SDL2/SDL_events.h> #include <SDL2/SD...
PucklaMotzer09/3DEngine
include/Vector2.h
#pragma once #include "../include/mathematics_functions.h" #include <GL/glew.h> #include <cmath> #include <iostream> namespace Johnny { template <class T> class Vector2; template <class T> const Vector2<T> operator+(const Vector2<T> &, const Vector2<T> &); template <class T> const Vector2<T> operator-(const...
PucklaMotzer09/3DEngine
include/Defines.h
#ifndef JOHNNY_DEFINES_H #define JOHNNY_DEFINES_H #define JOHNNY_RES (m_mainClass->getResourceManger()) #define JOHNNY_NATIVE_RES (m_mainClass->getNativeRes()) #define JOHNNY_NATIVE_RES_WIDTH (JOHNNY_NATIVE_RES.width) #define JOHNNY_NATIVE_RES_HEIGHT (JOHNNY_NATIVE_RES.height) #define JOHNNY_SKY (m_mainClass->g...
PucklaMotzer09/3DEngine
include/ShaderUpdater.h
<filename>include/ShaderUpdater.h<gh_stars>0 #ifndef SHADER_UPDATER_H #define SHADER_UPDATER_H #include "Geometry.h" namespace Johnny { class Shader; class Mesh3D; class Model3D; class Lighting3D; class Camera3D; class Transform3D; class Material; class Entity3D; class Sprite2D; class Skybox; class Transform2D; cla...
PucklaMotzer09/3DEngine
include/Geometry.h
<filename>include/Geometry.h<gh_stars>0 #pragma once #include "Vector2.h" #include <ostream> namespace Johnny { template <class T> class Rectangle; template <class T> std::ostream &operator<<(std::ostream &, const Rectangle<T> &); /*! \brief A class which represents a rectangle * \param T The type of the x...
PucklaMotzer09/3DEngine
include/Model3D.h
<reponame>PucklaMotzer09/3DEngine<filename>include/Model3D.h #pragma once #include "../include/Transform3D.h" #include <assimp/scene.h> #include <vector> namespace Johnny { class ResourceManager; class Mesh3D; class Shader; /*! \brief A class which represents a 3D model which consists of an array of * Mes...
PucklaMotzer09/3DEngine
include/Framework.h
<reponame>PucklaMotzer09/3DEngine #ifndef FRAMEWORK_H #define FRAMEWORK_H #include "Events.h" #include "JoystickListener.h" #include "Vector2.h" #include <GL/glew.h> #define ERROR_OUT(func, errorText) \ if (func < 0) ...
PucklaMotzer09/3DEngine
include/RenderTexture.h
#include "Geometry.h" #include "Texture.h" #include <GL/glew.h> namespace Johnny { class FrameBuffer; class Camera2D; /*! \brief A Texture that is attached to a FrameBuffer for easy to use render to * Texture * */ class RenderTexture : public Texture { public: /*! \brief Creates a new RenderTexture * \param ...
PucklaMotzer09/3DEngine
include/Shader.h
<reponame>PucklaMotzer09/3DEngine #pragma once #include "Geometry.h" #include "Matrix3.h" #include "Matrix4.h" #include "ShaderUpdater.h" #include "Vector2.h" #include "Vector3.h" #include "Vector4.h" #include <GL/glew.h> #include <map> #include <string> #include <vector> namespace Johnny { /*! \brief A ...
PucklaMotzer09/3DEngine
include/DebugMovement2D.h
#pragma once #include "Actor.h" namespace Johnny { /*! \brief A class which adds a small 2D DebugCameraMovement to the application * like camera scrolling, zooming and rotating * */ class DebugMovement2D : public Actor { public: /*! \brief Creates a new DebugMovement2D * \param moveSpeed The ...
PucklaMotzer09/3DEngine
include/LogManager.h
<reponame>PucklaMotzer09/3DEngine #ifndef LOGMANAGER_H #define LOGMANAGER_H #include <ctime> #include <string> extern void shutdownProgram(); namespace Johnny { /*! \brief A class which handles logging * */ class LogManager { public: LogManager(); virtual ~LogManager(); /*! \brief Sets the...
PucklaMotzer09/3DEngine
include/Transform2D.h
#pragma once #include "Matrix3.h" #include "Vector2.h" #include <GL/glew.h> #include <vector> namespace Johnny { class Camera2D; /*! \brief A class for calculating a transformation matrix * */ class Transform2D { public: Transform2D(); /*! \brief Creates a new Transform2D * \param translatio...
PucklaMotzer09/3DEngine
include/JoystickListenerEnums.h
#ifndef JOYSTICKLISTENERENUMS_H #define JOYSTICKLISTENERENUMS_H namespace Johnny { /*! \brief A enum which consists of all Buttons of a controller * */ enum Buttons { UP = 11, DOWN = 12, LEFT = 13, RIGHT = 14, START = 6, SELECT = 4, L3 = 7, R3 = 8, L1 = 9, R1 = 10, CROSS = 0, CIRCLE = 1, SQ...
PucklaMotzer09/3DEngine
include/Vector4.h
<gh_stars>0 #pragma once #include <GL/glew.h> #include <cmath> #include <iostream> namespace Johnny { template <class T> class Vector4; template <class T> const Vector4<T> operator+(const Vector4<T> &, const Vector4<T> &); template <class T> const Vector4<T> operator-(const Vector4<T> &, const Vector4<T> &);...
PucklaMotzer09/3DEngine
include/FrameBuffer.h
<gh_stars>0 #pragma once #include <GL/glew.h> namespace Johnny { class Texture; class RenderBuffer; /*! \brief a object-oriented implementation of a frame buffer object * to make it easier to use * */ class FrameBuffer { public: FrameBuffer(); ~FrameBuffer(); /*! \brief Attaches a texture...
PucklaMotzer09/3DEngine
include/JoystickManager.h
#ifndef JOYSTCKMANAGER_H #define JOYSTCKMANAGER_H #include "Events.h" #include <vector> namespace Johnny { class JoystickListener; /*! \brief The class which manages all controller specific things * */ class JoystickManager { public: JoystickManager(); virtual ~JoystickManager(); /*! \brief P...
alem-147/xv6-public
sysproc.c
<filename>sysproc.c<gh_stars>0 #include "types.h" #include "x86.h" #include "defs.h" #include "date.h" #include "param.h" #include "memlayout.h" #include "mmu.h" #include "proc.h" int sys_fork(void) { return fork(); } int sys_exit(void) { int exit_status; argint(0, &exit_status); //cprintf("exiting with status ...
alem-147/xv6-public
mytests.c
#include "types.h" #include "stat.h" #include "user.h" #define NULL 0 /* exit must return an exit status on all user programs lets do some forking to confirm the proccess are exiting with the proper exit statuses */ void exittest1(int status) { int pid,n; int fork_count = 3; printf(1,"I am the parent pro...
Lupus/libevfibers
include/evfibers/fiber.h
<gh_stars>100-1000 /******************************************************************** Copyright 2013 <NAME> <<EMAIL>> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://w...
Lupus/libevfibers
include/evfibers/eio.h
<gh_stars>100-1000 /******************************************************************** Copyright 2013 <NAME> <<EMAIL>> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://w...
Lupus/libevfibers
bench/condvar.c
/******************************************************************** Copyright 2013 <NAME> <<EMAIL>> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licen...
Lupus/libevfibers
src/fiber.c
/******************************************************************** Copyright 2013 <NAME> <<EMAIL>> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licen...
Lupus/libevfibers
include/evfibers_private/fiber.h
/******************************************************************** Copyright 2013 <NAME> <<EMAIL>> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licen...
SLingFeng/RxSwiftTest
test/Pods/Target Support Files/WPAttributedMarkup/WPAttributedMarkup-umbrella.h
<filename>test/Pods/Target Support Files/WPAttributedMarkup/WPAttributedMarkup-umbrella.h #ifdef __OBJC__ #import <UIKit/UIKit.h> #else #ifndef FOUNDATION_EXPORT #if defined(__cplusplus) #define FOUNDATION_EXPORT extern "C" #else #define FOUNDATION_EXPORT extern #endif #endif #endif #import "NSMutableString+TagReplace...
guyanyijiu/qx_partner
qx_partner.c
/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2017 The PHP Group | +--------------...
Pasyware/Http_Sniffer
src/hash_table.c
<filename>src/hash_table.c /* * hash_table.c * * Created on: Mar 16, 2012 * Author: front */ #include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <string.h> #include <assert.h> #include <sys/time.h> #include <unistd.h> #include "util.h" #include "flow.h" #include "packet.h" #define HASH_SIZ...
Pasyware/Http_Sniffer
src/tcp.c
/* * tcp.c * * Created on: Jun 15, 2011 * Author: chenxm */ #include <assert.h> #include "order.h" /* * Search for a continuous segment in order */ static seq_t *tcp_cont_seq(seq_t *lst) { while (lst->next != NULL && lst->nxt_seq == lst->next->seq) lst = lst->next; return lst; } /* * r...
Pasyware/Http_Sniffer
src/packet.c
<reponame>Pasyware/Http_Sniffer /* * packet.c * * Created on: Mar 16, 2012 * Author: chenxm * Email: <EMAIL> */ #include <stdlib.h> #include <string.h> #include <pthread.h> #include <netinet/in.h> #include "packet.h" #include "util.h" /* * Create new packet */ packet_t* packet_new(void) { packet_t *p...
Pasyware/Http_Sniffer
include/flow.h
<filename>include/flow.h<gh_stars>100-1000 /* * flow.h * * Created on: Jun 10, 2011 * Author: chenxm */ #ifndef FLOW_H_ #define FLOW_H_ #include <pthread.h> #include <sys/types.h> #include "packet.h" #include "order.h" #include "http.h" #include "util.h" /** * flow socket */ typedef struct _flow_s flow_...
Pasyware/Http_Sniffer
include/tcp.h
/* * tcp.h * * Created on: Jun 15, 2011 * Author: chenxm */ #ifndef __TCP_H__ #define __TCP_H__ #include "order.h" #include "util.h" int tcp_order(order_t *ord, seq_t *new_seq, BOOL src); int tcp_order_check(order_t *order); // for debugging #endif /* __TCP_H__ */
Pasyware/Http_Sniffer
include/order.h
<reponame>Pasyware/Http_Sniffer #ifndef __ORDER_H__ #define __ORDER_H__ #include <sys/types.h> #include "packet.h" #include "util.h" typedef struct _seq_t seq_t; struct _seq_t{ packet_t *pkt; /* packet */ u_int32_t seq; /* seq order */ u_int32_t nxt_seq; /* next in seq order */ BOOL ack; /* acknowledged */ ...
Pasyware/Http_Sniffer
src/order.c
<filename>src/order.c<gh_stars>100-1000 /* * order.c * * Created on: Jun 14, 2011 * Author: chenxm */ #include "packet.h" #include "util.h" #include "order.h" seq_t *seq_new(void){ seq_t *seq; seq = MALLOC(seq_t, 1); memset(seq, 0, sizeof(seq_t)); return seq; } void seq_free(seq_t *seq){ /* packet is ...
Pasyware/Http_Sniffer
src/flow_queue.c
/* * queue.c * * Created on: Mar 16, 2012 * Author: front */ #include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <string.h> #include <assert.h> #include <sys/time.h> #include <unistd.h> #include "util.h" #include "flow.h" static pthread_mutex_t mutex_queue; static flow_t *flow_queue_first ...
Pasyware/Http_Sniffer
include/util.h
<gh_stars>100-1000 /* util.h */ #ifndef __UTIL_H__ #define __UTIL_H__ #include <sys/types.h> /************************Macros*****************************/ #define MALLOC(type, num) (type *) check_malloc((num) * sizeof(type)) #ifndef BOOL #define BOOL int #endif /* BOOL */ #ifndef TRUE #define TRUE 1 #endif /* TRU...
Pasyware/Http_Sniffer
src/packet_queue.c
/* * queue.c * * Created on: Mar 16, 2012 * Author: chenxm * Email: <EMAIL> */ #include <stdlib.h> #include <string.h> #include <pthread.h> #include "packet.h" #include "util.h" /* Queue vars */ static unsigned int que_len = 0; static packet_t *pkt_first = NULL; static packet_t *pkt_last = NULL; static p...
Pasyware/Http_Sniffer
src/main.c
<filename>src/main.c #include <stdio.h> #include <stdlib.h> #include <string.h> #include <pthread.h> #include <time.h> #include <assert.h> #include <unistd.h> /* getopt() */ #include <netinet/in.h> #include <pcap.h> #include "packet.h" #include "flow.h" #include "util.h" #include "io.h" int GP_CAP_FIN = 0; /* Flag f...
Pasyware/Http_Sniffer
include/io.h
/* * io.h * * Created on: Mar. 12, 2015 * Author: chenxm */ #ifndef IO_H_ #define IO_H_ void flow_print(const flow_t *flow); void save_flow_json(const flow_t *flow, const char* file); #endif
souravverma94/grpc-fs
messages.h
<gh_stars>1-10 #pragma once #include <cstdint> #include <string> #include "grpc_fs.grpc.pb.h" grpcfs::FileId MakeFileId(std::int32_t id); grpcfs::FileContent MakeFileContent(std::int32_t id, std::string name, const void* data, size_t data_len);
souravverma94/grpc-fs
sequential_file_reader.h
<reponame>souravverma94/grpc-fs #pragma once #include <string> #include <cstdint> #include <memory> #include <functional> // SequentialFileReader: Read a file using using mmap(). Attempt to overlap reads of the file and writes by the user's code // by reading the next segment class SequentialFileReader { public: ...
a2gs/calcDate
src/libAddSubDate.c
/* <NAME> (a2gs) * <EMAIL> * * Lib calcDate * * MIT License * */ /* libAddSubDate.c * Lib do add/subtract date. * * Who | When | What * --------+------------+---------------------------- * a2gs | 03/03/2019 | Creation * | | */ /* *** INCLUDES ***********************...
a2gs/calcDate
src/sample.c
/* <NAME> (a2gs) * <EMAIL> * * Sample lib calcDate * * MIT License * */ /* sample.c * Sample to lib calcDate * * Who | When | What * --------+------------+---------------------------- * a2gs | 03/03/2019 | Creation * | | */ /* *** INCLUDES **************************...
a2gs/calcDate
inc/libAddSubDate.h
/* <NAME> (a2gs) * <EMAIL> * * Lib calcDate * * MIT License * */ /* libAddSubDate.h * Library calcDate include file * * Who | When | What * --------+------------+---------------------------- * a2gs | 03/03/2019 | Creation * | | */ #ifndef __LIB_A2GS_ADDSUBDATE_H__ #...
me-ve/txt_to_c_array
txt_to_c_array.c
#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> #define ARRAY_TYPE_INDEX 3 #define ARRAY_NAME_INDEX 4 int main(int argc, char **argv){ if(argc != 5){ fprintf(stderr, "Usage: %s <input> <output> <array_type> <array_name>\n", argv[0]); return 1; } FILE *input = fopen(argv[1], "r"); ...
maximeh/dispatch
src/dispatch.c
/* Author: <NAME> <EMAIL> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and ...
maximeh/dispatch
src/tools.c
/* Author: <NAME> <EMAIL> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and ...
maximeh/dispatch
src/tools.h
/* Author: <NAME> <EMAIL> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and ...
maximeh/dispatch
src/files.c
/* Author: <NAME> <EMAIL> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and ...
eduardocastrodev/study-notes
01-SEMESTRE/PROGRAMACAO-COMPUTACIONAL-SBL0086/langC-lista03/Exerc02.c
<reponame>eduardocastrodev/study-notes /* * Descrição: Lista 03 - Questão 02 * Aluno: <NAME> * Matrícula: 514554 * Data atual: 16/11/2021 */ #include <stdio.h> int main() { int number; printf("Digite um número: "); scanf("%d", &number); printf("O valor lido foi %d. \n", number); return 0; }
eduardocastrodev/study-notes
01-SEMESTRE/PROGRAMACAO-COMPUTACIONAL-SBL0086/langC-lista03/Exerc04.c
/* * Descrição: Lista 03 - Questão 04 * Aluno: <NAME> * Matrícula: 514554 * Data atual: 16/11/2021 */ #include <stdio.h> int main() { float number; printf("Digite um número: "); scanf("%f", &number); printf("O valor lido foi %d. \n", number); return 0; } /* * Como visto em aulas anteriores, os tip...
eduardocastrodev/study-notes
01-SEMESTRE/PROGRAMACAO-COMPUTACIONAL-SBL0086/langC-lista03/Exerc10.c
<filename>01-SEMESTRE/PROGRAMACAO-COMPUTACIONAL-SBL0086/langC-lista03/Exerc10.c /* * Descrição: Lista 03 - Questão 10 * Aluno: <NAME> * Matrícula: 514554 * Data atual: 16/11/2021 */ #include <stdio.h> int main() { int day, month, year; do { printf("Dia: "); scanf("%d", &day); } while (day < 1 || day > 31...
eduardocastrodev/study-notes
01-SEMESTRE/PROGRAMACAO-COMPUTACIONAL-SBL0086/langC-lista03/Exerc08.c
/* * Descrição: Lista 03 - Questão 08 * Aluno: <NAME> * Matrícula: 514554 * Data atual: 16/11/2021 */ #include <stdio.h> int main(){ int x, y; printf("Digite um numero: "); scanf(" %d", &x); printf("Digite outro numero: "); scanf(" %d", &y); printf("Ordem da digitação: \n"); printf...
eduardocastrodev/study-notes
01-SEMESTRE/PROGRAMACAO-COMPUTACIONAL-SBL0086/langC-lista03/Exerc13.c
<reponame>eduardocastrodev/study-notes<gh_stars>0 /* * Descrição: Lista 03 - Questão 13 * Aluno: <NAME> * Matrícula: 514554 * Data atual: 16/11/2021 */ #include <stdio.h> int main() { char c; printf("Digite um caracter: "); scanf(" %c", &c); for (int i = 0; i < 3; i++) { printf("%c\n", c); } ...
eduardocastrodev/study-notes
01-SEMESTRE/PROGRAMACAO-COMPUTACIONAL-SBL0086/langC-lista03/Exerc03.c
<filename>01-SEMESTRE/PROGRAMACAO-COMPUTACIONAL-SBL0086/langC-lista03/Exerc03.c /* * Descrição: Lista 03 - Questão 03 * Aluno: <NAME> * Matrícula: 514554 * Data atual: 16/11/2021 */ #include <stdio.h> int main() { int number; printf("Digite um número: "); scanf("%d", &number); printf("O valor lido foi ...
eduardocastrodev/study-notes
01-SEMESTRE/PROGRAMACAO-COMPUTACIONAL-SBL0086/langC-Uni08/Exerc03.c
/** * Arquivo: Exerc01 * Autor: <NAME> (<EMAIL>) * Data: 2022-01-22 * Descrição: * Elabore algoritmos em C para ler uma matriz de inteiros N x N e: a. Mostrar cada elemento da matriz; b. Calcular e mostrar a soma dos elementos da matriz; c. Calcular e mostrar o maior e o menor elemento da matriz; ...
eduardocastrodev/study-notes
01-SEMESTRE/PROGRAMACAO-COMPUTACIONAL-SBL0086/langC-lista03/Exerc01.c
/* * Descrição: Lista 03 - Questão 01 * Aluno: <NAME> * Matrícula: 514554 * Data atual: 16/11/2021 */ #include <stdio.h> int main() { printf("Início do programa\n"); printf("----\n"); printf("Fim do programa\n"); return 0; }
eduardocastrodev/study-notes
01-SEMESTRE/PROGRAMACAO-COMPUTACIONAL-SBL0086/langC-lista03/Exerc12.c
/* * Descrição: Lista 03 - Questão 12 * Aluno: <NAME> * Matrícula: 514554 * Data atual: 16/11/2021 */ #include <stdio.h> int main() { char c; printf("Digite um caractere: "); scanf("%c", &c); printf("O caractere digitado foi \"%c\"\n", c); return 0; }
eduardocastrodev/study-notes
01-SEMESTRE/PROGRAMACAO-COMPUTACIONAL-SBL0086/langC-lista03/Exerc07.c
<reponame>eduardocastrodev/study-notes<filename>01-SEMESTRE/PROGRAMACAO-COMPUTACIONAL-SBL0086/langC-lista03/Exerc07.c /* * Descrição: Lista 03 - Questão 07 * Aluno: <NAME> * Matrícula: 514554 * Data atual: 16/11/2021 */ #include <stdio.h> int main(){ int number[2]; for (int i = 0; i <= 1; i++) { p...
eduardocastrodev/study-notes
01-SEMESTRE/PROGRAMACAO-COMPUTACIONAL-SBL0086/langC-lista03/Exerc06.c
/* * Descrição: Lista 03 - Questão 06 * Aluno: <NAME> * Matrícula: 514554 * Data atual: 16/11/2021 */ #include <stdio.h> int main(){ char c; printf("Digite um caractere: "); scanf(" %c",&c); printf("O caractere %c assume os seguintes valores: \n", c); printf("Em decimal: %d \n",c); ...
eduardocastrodev/study-notes
01-SEMESTRE/PROGRAMACAO-COMPUTACIONAL-SBL0086/langC-lista03/Exerc14.c
/* * Descrição: Lista 03 - Questão 14 * Aluno: <NAME> * Matrícula: 514554 * Data atual: 16/11/2021 */ #include <stdio.h> int main() { char c; int i; float f; printf("Digite um caracter: "); scanf(" %c", &c); printf("Digite um numero inteiro: "); scanf(" %d", &i); printf("Digite um numero real: "...
eduardocastrodev/study-notes
01-SEMESTRE/PROGRAMACAO-COMPUTACIONAL-SBL0086/langC-lista03/Exerc09.c
<reponame>eduardocastrodev/study-notes /* * Descrição: Lista 03 - Questão 09 * Aluno: <NAME> * Matrícula: 514554 * Data atual: 16/11/2021 */ #include <stdio.h> int main() { float number[2]; for (int i = 0; i <= 1; i++) { printf("Digite o %dº numero: ", (i + 1)); scanf(" %f", &number[i]); } for (int i =...
eduardocastrodev/study-notes
01-SEMESTRE/PROGRAMACAO-COMPUTACIONAL-SBL0086/langC-Uni08/Exerc01.c
<gh_stars>0 /** * Arquivo: Exerc01; * Autor: <NAME> (<EMAIL>); * Data: 2022-01-22; * Descrição: * Ler um vetor Q de 20 posições (aceitar somente números positivos). Escrever a * seguir o valor do maior elemento de Q e a respectiva posição que ele ocupa no vetor. */ #include <stdio.h> int main() { int Q[21], ...
eduardocastrodev/study-notes
01-SEMESTRE/PROGRAMACAO-COMPUTACIONAL-SBL0086/langC-lista03/Exerc11.c
/* * Descrição: Lista 03 - Questão 11 * Aluno: <NAME> * Matrícula: 514554 * Data atual: 16/11/2021 */ #include <stdio.h> int main() { const int NUMBER = 5; printf("valor da constante: %d\n", NUMBER); scanf("%d", &NUMBER); printf("Valor trocado: %d\n", NUMBER); return 0; } /* * Podem ocorrer erros ...
eduardocastrodev/study-notes
01-SEMESTRE/PROGRAMACAO-COMPUTACIONAL-SBL0086/langC-lista03/Exerc05.c
/* * Descrição: Lista 03 - Questão 05 * Aluno: <NAME> * Matrícula: 514554 * Data atual: 16/11/2021 */ #include <stdio.h> int main(){ double number=0.0; printf("Digite um número: "); scanf("%lf",&number); printf("O numero %.6lf em notacao cientifica fica %.4e\n", number, number); re...
syang2forever/jos
jos/lib/ipc.c
<reponame>syang2forever/jos // User-level IPC library routines #include <inc/lib.h> // Receive a value via IPC and return it. // If 'pg' is nonnull, then any page sent by the sender will be mapped at // that address. // If 'from_env_store' is nonnull, then store the IPC sender's envid in // *from_env_store. // If 'pe...
syang2forever/jos
jos/user/faultnostack.c
<reponame>syang2forever/jos<gh_stars>100-1000 // test user fault handler being called with no exception stack mapped #include <inc/lib.h> void _pgfault_upcall(); void umain(int argc, char **argv) { sys_env_set_pgfault_upcall(0, (void*) _pgfault_upcall); *(int*)0 = 0; }
syang2forever/jos
jos/user/faultallocbad.c
// test user-level fault handler -- alloc pages to fix faults // doesn't work because we sys_cputs instead of cprintf (exercise: why?) #include <inc/lib.h> void handler(struct UTrapframe *utf) { int r; void *addr = (void*)utf->utf_fault_va; cprintf("fault %x\n", addr); if ((r = sys_page_alloc(0, ROUNDDOWN(addr, ...
syang2forever/jos
jos/kern/cpu.h
#ifndef JOS_INC_CPU_H #define JOS_INC_CPU_H #include <inc/types.h> #include <inc/memlayout.h> #include <inc/mmu.h> #include <inc/env.h> // Maximum number of CPUs #define NCPU 8 // Values of status in struct Cpu enum { CPU_UNUSED = 0, CPU_STARTED, CPU_HALTED, }; // Per-CPU state struct CpuInfo { uint8_t cpu_id...
syang2forever/jos
jos/user/faultevilhandler.c
// test evil pointer for user-level fault handler #include <inc/lib.h> void umain(int argc, char **argv) { sys_page_alloc(0, (void*) (UXSTACKTOP - PGSIZE), PTE_P|PTE_U|PTE_W); sys_env_set_pgfault_upcall(0, (void*) 0xF0100020); *(int*)0 = 0; }
syang2forever/jos
jos/user/yield.c
<filename>jos/user/yield.c // yield the processor to other environments #include <inc/lib.h> void umain(int argc, char **argv) { int i; cprintf("Hello, I am environment %08x.\n", thisenv->env_id); for (i = 0; i < 5; i++) { sys_yield(); cprintf("Back in environment %08x, iteration %d.\n", thisenv->env_id, i...
syang2forever/jos
jos/kern/sched.h
<reponame>syang2forever/jos<gh_stars>100-1000 /* See COPYRIGHT for copyright information. */ #ifndef JOS_KERN_SCHED_H #define JOS_KERN_SCHED_H #ifndef JOS_KERNEL # error "This is a JOS kernel header; user programs should not #include it" #endif // This function does not return. void sched_yield(void) __attribute__((n...
syang2forever/jos
jos/fs/test.c
#include <inc/x86.h> #include <inc/string.h> #include "fs.h" static char *msg = "This is the NEW message of the day!\n\n"; void fs_test(void) { struct File *f; int r; char *blk; uint32_t *bits; // back up bitmap if ((r = sys_page_alloc(0, (void*) PGSIZE, PTE_P|PTE_U|PTE_W)) < 0) panic("sys_page_alloc: %e", ...
syang2forever/jos
jos/user/idle.c
<reponame>syang2forever/jos<gh_stars>100-1000 // idle loop #include <inc/x86.h> #include <inc/lib.h> void umain(int argc, char **argv) { binaryname = "idle"; // Loop forever, simply trying to yield to a different environment. // Instead of busy-waiting like this, // a better way would be to use the processor's H...
syang2forever/jos
jos/lib/libmain.c
<filename>jos/lib/libmain.c // Called from entry.S to get us going. // entry.S already took care of defining envs, pages, uvpd, and uvpt. #include <inc/lib.h> extern void umain(int argc, char **argv); const volatile struct Env *thisenv; const char *binaryname = "<unknown>"; void libmain(int argc, char **argv) { //...
syang2forever/jos
jos/user/sendpage.c
<filename>jos/user/sendpage.c // Test Conversation between parent and child environment // Contributed by <NAME> at <NAME> #include <inc/lib.h> const char *str1 = "hello child environment! how are you?"; const char *str2 = "hello parent environment! I'm good."; #define TEMP_ADDR ((char*)0xa00000) #define TEMP_ADDR_C...
syang2forever/jos
jos/kern/kclock.h
<filename>jos/kern/kclock.h /* See COPYRIGHT for copyright information. */ #ifndef JOS_KERN_KCLOCK_H #define JOS_KERN_KCLOCK_H #ifndef JOS_KERNEL # error "This is a JOS kernel header; user programs should not #include it" #endif #define IO_RTC 0x070 /* RTC port */ #define MC_NVRAM_START 0xe /* start of NVRAM: offs...
syang2forever/jos
jos/inc/kbdreg.h
#ifndef JOS_KBDREG_H #define JOS_KBDREG_H // Special keycodes #define KEY_HOME 0xE0 #define KEY_END 0xE1 #define KEY_UP 0xE2 #define KEY_DN 0xE3 #define KEY_LF 0xE4 #define KEY_RT 0xE5 #define KEY_PGUP 0xE6 #define KEY_PGDN 0xE7 #define KEY_INS 0xE8 #define KEY_DEL 0xE9 /* This is i8042reg.h + kbdreg.h from N...