repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
LarsGardien/HackerDogeAir | src/pages/home/home.c | #include "pages/home/home.h"
#include <stdbool.h>
#include <limits.h>
#include <time.h>
#include <libscrypt.h>
#include <kore/kore.h>
#include <kore/http.h>
#include <kore/pgsql.h>
#include "shared/shared_error.h"
#include "shared/shared_http.h"
#include "pages/home/home_render.h"
#include "model/user.h"
#include "m... |
LarsGardien/HackerDogeAir | src/includes/pages/user/user_actions_render.h | <reponame>LarsGardien/HackerDogeAir<gh_stars>0
#ifndef USER_ACTIONS_RENDER_H
#define USER_ACTIONS_RENDER_H
#include "pages/partial/partial_render.h"
int
user_actions_render(PartialContext *context);
void
user_actions_render_clean(PartialContext *context);
#endif |
LarsGardien/HackerDogeAir | src/init.c | <reponame>LarsGardien/HackerDogeAir<gh_stars>0
#include <kore/kore.h>
#include <kore/pgsql.h>
int init(int);
int
init(int state)
{
/* Register our database. */
/* This will result as a string in our binary and is not save at all! */
kore_pgsql_register("DogeAir", "host=localhost dbname=DogeAir user=ha... |
LarsGardien/HackerDogeAir | src/includes/pages/flight/flight_search/flight_search_render.h | #ifndef FLIGHT_SEARCH_RENDER_H
#define FLIGHT_SEARCH_RENDER_H
#include <mustache.h>
#include <sys/queue.h>
#include <stdbool.h>
#include <time.h>
#include "pages/partial/partial_render.h"
#include "model/flight.h"
typedef struct FlightSearchParams
{
struct tm arrivaldate;
} FlightSearchParams;
typedef struct F... |
LarsGardien/HackerDogeAir | src/pages/admin/givepoints/givepoints_render.c | <filename>src/pages/admin/givepoints/givepoints_render.c
#include "pages/admin/givepoints/givepoints_render.h"
#include <stdbool.h>
#include <kore/kore.h>
#include <mustache.h>
#include "assets.h"
#include "shared/shared_error.h"
#include "pages/partial/partial_render.h"
#include "pages/shared/shared_user_render.h"
... |
LarsGardien/HackerDogeAir | src/includes/model/airport.h | <gh_stars>0
#ifndef AIRPORT_H
#define AIRPORT_H
#include <stdint.h>
#include <sys/queue.h>
typedef struct _Airport
{
uint32_t identifier;
char *name;
char *location;
} Airport;
typedef struct AirportCollectionNode
{
Airport *airport;
TAILQ_ENTRY(AirportCollectionNode) airpor... |
LarsGardien/HackerDogeAir | src/includes/pages/admin/admin_render.h | #ifndef ADMIN_RENDER_H
#define ADMIN_RENDER_H
#include <mustache.h>
#include "pages/partial/partial_render.h"
int
admin_render(PartialContext *context);
void
admin_render_clean(PartialContext *context);
#endif |
LarsGardien/HackerDogeAir | src/model/session.c | <filename>src/model/session.c
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <sys/queue.h>
#include <time.h>
#include <kore/kore.h>
#include <kore/pgsql.h>
#include <kore/http.h>
#include "includes/model/session.h"
#include "includes/model/database_engine.h"
#include "shared/s... |
LarsGardien/HackerDogeAir | src/includes/pages/admin/flightlist/flightlist_render.h | <reponame>LarsGardien/HackerDogeAir
#ifndef FLIGHTLIST_RENDER_H
#define FLIGHTLIST_RENDER_H
#include <mustache.h>
#include <sys/queue.h>
#include "pages/partial/partial_render.h"
#include "model/flight.h"
typedef struct FlightListContext
{
PartialContext partial_context;
const char *error_message;
struct... |
LarsGardien/HackerDogeAir | src/pages/user/user_bookings/user_bookings_render.c | <gh_stars>0
#include "pages/user/user_bookings/user_bookings_render.h"
#include "pages/admin/bookinglist/bookinglist_render.h"
#include "pages/shared/shared_booking_render.h"
#include <stdbool.h>
#include <kore/kore.h>
#include <mustache.h>
#include <sys/queue.h>
#include "assets.h"
#include "shared/shared_error.h"
#... |
LarsGardien/HackerDogeAir | src/includes/pages/login/login_render.h | <reponame>LarsGardien/HackerDogeAir<filename>src/includes/pages/login/login_render.h
#ifndef LOGIN_RENDER_H
#define LOGIN_RENDER_H
#include <mustache.h>
#include <stdbool.h>
#include "pages/partial/partial_render.h"
#include "pages/shared/shared_user_render.h"
typedef struct LoginContext {
UserContext user_conte... |
LarsGardien/HackerDogeAir | src/pages/admin/userlist/userlist_render.c | <reponame>LarsGardien/HackerDogeAir<filename>src/pages/admin/userlist/userlist_render.c
#include "pages/admin/userlist/userlist_render.h"
#include <stdbool.h>
#include <kore/kore.h>
#include <mustache.h>
#include "assets.h"
#include "shared/shared_error.h"
#include "pages/partial/partial_render.h"
#include "pages/sh... |
LarsGardien/HackerDogeAir | src/pages/shared/shared_user_render.c | #include "pages/shared/shared_user_render.h"
#include <kore/kore.h>
#include <mustache.h>
uintmax_t
user_varget(mustache_api_t *api, void *userdata, mustache_token_variable_t *token)
{
UserContext *ctx = (UserContext *) userdata;
const char *output_string = NULL;
if(strncmp("id", token->text, token->text... |
LarsGardien/HackerDogeAir | src/pages/user/user_detail/user_detail.c | #include <stdbool.h>
#include <limits.h>
#include <mustache.h>
#include <kore/kore.h>
#include <kore/http.h>
#include <kore/pgsql.h>
#include "shared/shared_error.h"
#include "shared/shared_http.h"
#include "pages/user/user_detail/user_detail_render.h"
#include "model/user.h"
#include "model/session.h"
#include "asse... |
LarsGardien/HackerDogeAir | src/includes/model/user.h | #ifndef USER_H
#define USER_H
#include <stdint.h>
#include <sys/queue.h>
#include <time.h>
#include "role.h"
typedef struct
{
uint32_t identifier;
Role role;
char *email;
char *username;
char *first_name;
char *last_name;
char *telephone_numbe... |
LarsGardien/HackerDogeAir | src/includes/shared/shared_error.h | <filename>src/includes/shared/shared_error.h
#ifndef SHARED_ERROR_H
#define SHARED_ERROR_H
#include <kore/http.h>
/* Shared error codes. */
#define SHARED_OK 0
/* Database access specific error codes. */
#define DATABASE_ENGINE_ERROR_NO_RESULTS 11
#define DATABASE_ENGINE_... |
LarsGardien/HackerDogeAir | src/includes/pages/admin/givepoints/givepoints_render.h | #ifndef GIVEPOINTS_RENDER_H
#define GIVEPOINTS_RENDER_H
#include <mustache.h>
#include "pages/partial/partial_render.h"
#include "pages/shared/shared_user_render.h"
int
admin_give_points_render(UserContext *context);
void
admin_give_points_render_clean(UserContext *context);
#endif |
LarsGardien/HackerDogeAir | src/includes/pages/register/register_render.h | #ifndef REGISTER_RENDER_H
#define REGISTER_RENDER_H
#include <mustache.h>
#include <stdbool.h>
#include "pages/partial/partial_render.h"
#include "pages/shared/shared_user_render.h"
#include "model/user.h"
int
register_render(UserContext *context);
void
register_render_clean(UserContext *context);
#endif |
LarsGardien/HackerDogeAir | src/pages/flight/flight_book/flight_book.c | #include <stdbool.h>
#include <kore/kore.h>
#include <kore/http.h>
#include <kore/pgsql.h>
#include "shared/shared_error.h"
#include "shared/shared_http.h"
#include "model/flight.h"
#include "assets.h"
#define FLIGHT_BOOK_RESULT_OK 0
#define FLIGHT_BOOK_RESULT_NO_SEATS_AVAILABLE 1
#define FLIGHT_... |
LarsGardien/HackerDogeAir | src/pages/admin/admin_render.c | <gh_stars>0
#include "pages/admin/admin_render.h"
#include <stdbool.h>
#include <kore/kore.h>
#include <mustache.h>
#include "assets.h"
#include "shared/shared_error.h"
#include "pages/partial/partial_render.h"
#include "model/user.h"
int admin_render(PartialContext *);
void admin_render_clean(Partia... |
LarsGardien/HackerDogeAir | src/pages/login/login_render.c | <filename>src/pages/login/login_render.c<gh_stars>0
#include "pages/login/login_render.h"
#include <stdbool.h>
#include <kore/kore.h>
#include <mustache.h>
#include "assets.h"
#include "shared/shared_error.h"
#include "pages/partial/partial_render.h"
#include "pages/shared/shared_user_render.h"
#include "model/user.... |
LarsGardien/HackerDogeAir | src/includes/model/login_attempt.h | <filename>src/includes/model/login_attempt.h<gh_stars>0
#ifndef LOGIN_ATTEMPT_H
#define LOGIN_ATTEMPT_H
#include <stdint.h>
#include <time.h>
#include <sys/queue.h>
typedef struct
{
uint32_t user_identifier;
struct tm login_attempt_date_time;
bool login_result;
} LoginAttempt;
typedef struct ... |
LarsGardien/HackerDogeAir | src/includes/pages/shared/shared_user_render.h | #ifndef SHARED_USER_RENDER_H
#define SHARED_USER_RENDER_H
#include "pages/partial/partial_render.h"
#include "model/user.h"
#include "model/role.h"
typedef struct UserContext
{
PartialContext partial_context;
const char *error_message;
User *user;
} UserContext;
uintmax_t
user_varget(mustache_api_t *api,... |
LarsGardien/HackerDogeAir | src/pages/partial/header/header_render.c | <filename>src/pages/partial/header/header_render.c
#include "pages/partial/header/header_render.h"
#include <stdio.h>
#include <kore/kore.h>
#include <mustache.h>
#include <stdbool.h>
#include "shared/shared_error.h"
#include "model/user.h"
#include "model/role.h"
#include "assets.h"
int header_render(PartialContext... |
LarsGardien/HackerDogeAir | src/model/user.c | #include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <sys/queue.h>
#include <time.h>
#include <kore/kore.h>
#include <kore/pgsql.h>
#include <kore/http.h>
#include "includes/model/user.h"
#include "includes/model/role.h"
#include "includes/model/database_engine.h"
#include "shared/s... |
LarsGardien/HackerDogeAir | src/includes/model/ticket.h | <filename>src/includes/model/ticket.h
#ifndef TICKET_H
#define TICKET_H
#include <stdint.h>
#include <sys/queue.h>
typedef struct
{
uint32_t ticket_identifier;
uint32_t flight_identifier;
uint32_t user_identifier;
uint32_t cost;
} Ticket;
typedef struct TicketCollectionNode
{
Ticket ... |
LarsGardien/HackerDogeAir | src/includes/pages/admin/bookinglist/bookinglist_render.h | <filename>src/includes/pages/admin/bookinglist/bookinglist_render.h
#ifndef BOOKINGLIST_RENDER_H
#define BOOKINGLIST_RENDER_H
#include <mustache.h>
#include "pages/partial/partial_render.h"
#include "model/ticket.h"
typedef struct BookingListContext
{
PartialContext partial_context;
const char *error_message... |
LarsGardien/HackerDogeAir | src/pages/admin/bookinglist/bookinglist.c | <filename>src/pages/admin/bookinglist/bookinglist.c
#include <stdbool.h>
#include <limits.h>
#include <time.h>
#include <stdint.h>
#include <libscrypt.h>
#include <kore/kore.h>
#include <kore/http.h>
#include <kore/pgsql.h>
#include "shared/shared_error.h"
#include "shared/shared_http.h"
#include "pages/admin/booking... |
LarsGardien/HackerDogeAir | src/includes/pages/home/home.h | #ifndef HOME_H
#define HOME_H
#include <kore/kore.h>
int
home(struct http_request *req);
#endif |
LarsGardien/HackerDogeAir | src/pages/login/login.c | <reponame>LarsGardien/HackerDogeAir
#include <stdbool.h>
#include <limits.h>
#include <time.h>
#include <libscrypt.h>
#include <kore/kore.h>
#include <kore/http.h>
#include <kore/pgsql.h>
#include "shared/shared_error.h"
#include "shared/shared_http.h"
#include "pages/login/login_render.h"
#include "model/user.h"
#in... |
LarsGardien/HackerDogeAir | src/includes/model/role.h | <gh_stars>0
#ifndef ROLE_H
#define ROLE_H
typedef enum{
USER = 0,
ADMIN = 1,
} Role;
#endif |
LarsGardien/HackerDogeAir | src/shared/shared_time.c | #define _XOPEN_SOURCE 700 //must be defined for strptime from time.h
#include "shared/shared_time.h"
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <time.h>
#include "shared/shared_error.h"
char *
shared_time_tm_to_database_string(const struct tm *time, char *destination_string, uintmax_t size, ... |
LarsGardien/HackerDogeAir | src/pages/admin/userlist/userlist.c | <reponame>LarsGardien/HackerDogeAir
#include <stdbool.h>
#include <limits.h>
#include <time.h>
#include <libscrypt.h>
#include <kore/kore.h>
#include <kore/http.h>
#include <kore/pgsql.h>
#include "shared/shared_error.h"
#include "shared/shared_http.h"
#include "pages/admin/userlist/userlist_render.h"
#include "model... |
LarsGardien/HackerDogeAir | src/model/flight.c | <reponame>LarsGardien/HackerDogeAir
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <kore/kore.h>
#include <kore/pgsql.h>
#include "model/flight.h"
#include "shared/shared_error.h"
#include "shared/shared_time.h"
#include "model/database_engine.h"
static con... |
LarsGardien/HackerDogeAir | src/pages/register/register.c | #include <stdbool.h>
#include <limits.h>
#include <libscrypt.h>
#include <kore/kore.h>
#include <kore/http.h>
#include <kore/pgsql.h>
#include "shared/shared_error.h"
#include "shared/shared_http.h"
#include "pages/register/register_render.h"
#include "model/session.h"
#include "model/user.h"
#include "assets.h"
in... |
LarsGardien/HackerDogeAir | src/pages/user/user_bookings/user_bookings.c | <gh_stars>0
#include <stdbool.h>
#include <limits.h>
#include <mustache.h>
#include <kore/kore.h>
#include <kore/http.h>
#include <kore/pgsql.h>
#include "shared/shared_error.h"
#include "shared/shared_http.h"
#include "pages/user/user_bookings/user_bookings_render.h"
#include "model/user.h"
#include "model/session.h... |
LarsGardien/HackerDogeAir | src/pages/admin/givepoints/givepoints.c | #include <stdbool.h>
#include <limits.h>
#include <time.h>
#include <libscrypt.h>
#include <kore/kore.h>
#include <kore/http.h>
#include <kore/pgsql.h>
#include "shared/shared_error.h"
#include "shared/shared_http.h"
#include "pages/admin/givepoints/givepoints_render.h"
#include "pages/shared/shared_user_render.h"
#i... |
LarsGardien/HackerDogeAir | src/pages/logout/logout.c | #include <kore/kore.h>
#include <kore/http.h>
#include "shared/shared_session.h"
#include "pages/home/home.h"
#include "assets.h"
uint32_t logout(struct http_request *req);
uint32_t
logout(struct http_request *req)
{
auth_remove(req);
http_response_header(req, "content-type", "text/html");
http_respons... |
LarsGardien/HackerDogeAir | src/pages/admin/flightlist/flightlist.c | <gh_stars>0
#include <stdbool.h>
#include <limits.h>
#include <time.h>
#include <libscrypt.h>
#include <kore/kore.h>
#include <kore/http.h>
#include <kore/pgsql.h>
#include "shared/shared_error.h"
#include "shared/shared_http.h"
#include "pages/admin/flightlist/flightlist_render.h"
#include "model/flight.h"
#include ... |
LarsGardien/HackerDogeAir | src/includes/pages/partial/header/header_render.h | <reponame>LarsGardien/HackerDogeAir<gh_stars>0
#ifndef HEADER_RENDER_H
#define HEADER_RENDER_H
#include "pages/partial/partial_render.h"
int
header_render(PartialContext *context);
void
header_render_clean(PartialContext *context);
#endif |
LarsGardien/HackerDogeAir | src/includes/pages/login.h | #ifndef LOGIN_H
#define LOGIN_H
#include <stdint.h>
#include <stdbool.h>
#include <kore/kore.h>
#include <kore/http.h>
#include <kore/pgsql.h>
#include "model/user.h"
#include "pages/login/login_render.h"
uint32_t
login(
struct http_request *req
);
uint32_t
login_parse_params(
struct http_reque... |
LarsGardien/HackerDogeAir | src/pages/home/home_render.c | <gh_stars>0
#include "pages/home/home_render.h"
#include <stdbool.h>
#include <kore/kore.h>
#include <mustache.h>
#include "assets.h"
#include "shared/shared_error.h"
#include "pages/partial/partial_render.h"
#include "model/user.h"
int home_render(PartialContext *);
void home_render_clean(PartialCon... |
LarsGardien/HackerDogeAir | src/pages/admin/bookinglist/bookinglist_render.c | <gh_stars>0
#include "pages/admin/bookinglist/bookinglist_render.h"
#include <stdbool.h>
#include <kore/kore.h>
#include <mustache.h>
#include "assets.h"
#include "shared/shared_error.h"
#include "pages/partial/partial_render.h"
#include "pages/shared/shared_booking_render.h"
#include "model/ticket.h"
int a... |
LarsGardien/HackerDogeAir | src/pages/admin/deleteflight/deleteflight.c | <reponame>LarsGardien/HackerDogeAir
#include <stdbool.h>
#include <limits.h>
#include <time.h>
#include <libscrypt.h>
#include <kore/kore.h>
#include <kore/http.h>
#include <kore/pgsql.h>
#include "shared/shared_error.h"
#include "model/flight.h"
#include "assets.h"
int admin_delete_flight(struct http_reques... |
LarsGardien/HackerDogeAir | src/pages/flight/flight_search/flight_search_render.c | #include "pages/flight/flight_search/flight_search_render.h"
#include <stdbool.h>
#include <kore/kore.h>
#include <mustache.h>
#include <sys/queue.h>
#include "assets.h"
#include "model/flight.h"
#include "shared/shared_error.h"
#include "shared/shared_time.h"
#include "pages/partial/partial_render.h"
#include "pages... |
LarsGardien/HackerDogeAir | src/includes/shared/shared_http.h | <reponame>LarsGardien/HackerDogeAir<filename>src/includes/shared/shared_http.h<gh_stars>0
#ifndef SHARED_HTTP_H
#define SHARED_HTTP_H
#include <stdint.h>
#include <kore/http.h>
#include "model/user.h"
#include "model/session.h"
uint32_t
shared_http_get_user_from_request(struct http_request *req, User **user);
uint3... |
LarsGardien/HackerDogeAir | src/pages/shared/shared_booking_render.c | <gh_stars>0
#include "pages/shared/shared_booking_render.h"
#include <kore/kore.h>
#include <mustache.h>
#include "shared/shared_error.h"
#include "shared/shared_time.h"
uintmax_t
booking_varget(mustache_api_t *api, void *booking_data, mustache_token_variable_t *token)
{
BookingContext *ctx = (BookingContext *)... |
LarsGardien/HackerDogeAir | src/pages/register/register_render.c | <gh_stars>0
#include "pages/register/register_render.h"
#include <stdbool.h>
#include <kore/kore.h>
#include <mustache.h>
#include "assets.h"
#include "shared/shared_error.h"
#include "pages/partial/partial_render.h"
#include "pages/shared/shared_user_render.h"
#include "model/user.h"
int register_render(Us... |
LarsGardien/HackerDogeAir | src/model/database_engine.c | <reponame>LarsGardien/HackerDogeAir
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <errno.h>
#include <kore/kore.h>
#include <kore/http.h>
#include <kore/pgsql.h>
#include "model/database_engine.h"
#include "shared/shared_error.h"
static uint32_t
database_engine_initialize(
... |
LarsGardien/HackerDogeAir | src/includes/model/session.h | #ifndef SESSION_H
#define SESSION_H
#include <stdint.h>
#include <sys/queue.h>
#include <time.h>
typedef struct
{
char * identifier;
uint32_t user_identifier;
struct tm expiration_time;
} Session;
typedef struct SessionCollection
{
Session session;
TAILQ_ENTRY(SessionCollection) session... |
LarsGardien/HackerDogeAir | src/includes/pages/error/error_render.h | #ifndef ERROR_RENDER_H
#define ERROR_RENDER_H
#include "pages/partial/partial_render.h"
typedef struct ErrorContext {
PartialContext partial_context;
const char *error_message;
const char *redirect_uri;
int timeout;
} ErrorContext;
int
error_render(ErrorContext *context);
void
error_render_... |
LarsGardien/HackerDogeAir | src/pages/shared/shared_flight_render.c | <reponame>LarsGardien/HackerDogeAir<filename>src/pages/shared/shared_flight_render.c<gh_stars>0
#include "pages/shared/shared_flight_render.h"
#include <kore/kore.h>
#include <mustache.h>
#include "shared/shared_error.h"
#include "shared/shared_time.h"
uintmax_t
flight_varget(mustache_api_t *api, void *user_data, mu... |
LarsGardien/HackerDogeAir | src/includes/pages/shared/shared_booking_render.h | <filename>src/includes/pages/shared/shared_booking_render.h<gh_stars>0
#ifndef SHARED_BOOKING_RENDER_H
#define SHARED_BOOKING_RENDER_H
#include "pages/partial/partial_render.h"
#include "model/ticket.h"
typedef struct BookingContext
{
PartialContext partial_context;
const char *error_message;
Ticket *tick... |
LarsGardien/HackerDogeAir | src/model/ticket.c | <gh_stars>0
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <sys/queue.h>
#include <time.h>
#include <kore/kore.h>
#include <kore/pgsql.h>
#include <kore/http.h>
#include "model/ticket.h"
#include "model/database_engine.h"
#include "shared/shared_error.h"
#include "shared/share... |
LarsGardien/HackerDogeAir | src/includes/pages/shared/shared_flight_render.h | #ifndef SHARED_FLIGHT_RENDER_H
#define SHARED_FLIGHT_RENDER_H
#include "pages/partial/partial_render.h"
#include "model/flight.h"
typedef struct FlightContext
{
PartialContext partial_context;
const char *error_message;
Flight *flight;
} FlightContext;
uintmax_t
flight_varget(
mustache_api_t *api,
... |
LarsGardien/HackerDogeAir | src/includes/shared/shared_time.h | #ifndef SHARED_TIME_H
#define SHARED_TIME_H
#define SHARED_TIME_TM_TO_DATABASE_FORMAT_STRING_SIZE 27
#define SHARED_TIME_TM_TO_FORMAT_STRING_SIZE 20
#include <stdint.h>
#include <time.h>
char *
shared_time_tm_to_database_string(
const struct tm *time,
char *destination_string,
uintmax_t size,
uint3... |
LarsGardien/HackerDogeAir | src/includes/pages/admin/deleteflight/deleteflight_render.h | #ifndef DELETEFLIGHT_RENDER_H
#define DELETEFLIGHT_RENDER_H
#include <mustache.h>
#include "pages/partial/partial_render.h"
int
admin_delete_flight_render(PartialContext *context);
void
admin_delete_flight_render_clean(PartialContext *context);
#endif |
Jasdoge/NeoPocket | NeoPocket/Tools.h | #ifndef __Tools
#define __Tools
#include "Consts.h"
namespace Tools{
float getBatteryPercentage(){
// Take a battery reading and output it.
const uint16_t reading = analogRead(PIN_BAT_READ_IN);
float perc = ((reading+0.5)*2.5/1024.0); // Get actual voltage on pin
perc -= 1.7; // 1.7 is the value at 3.4... |
Jasdoge/NeoPocket | NeoPocket/KXTJ3-Min.h | <reponame>Jasdoge/NeoPocket
#include <Wire.h>
namespace Accelerometer{
const uint8_t XOUT_L = 0x06;
const uint8_t XOUT_H = 0x07;
const uint8_t YOUT_L = 0x08;
const uint8_t YOUT_H = 0x09;
const uint8_t ZOUT_L = 0x0A;
const uint8_t ZOUT_H = 0x0B;
const uint8_t DCST_RESP = 0x0C;
const uint8_t WHO_AM_I = 0x0F;
... |
Jasdoge/NeoPocket | AnimBuilder/_Configuration.h | #ifndef __Configuration
#define __Configuration
#include "Consts.h"
#include "Animator.h"
#include "Tools.h"
// Unquote to ignore battery charge detection
//#define DEBUG_IGNORE_BATTERY
namespace Configuration{
// Configuration
const uint32_t KEEPALIVE_DURATION = 30000; // On duration in milliseconds before sta... |
Jasdoge/NeoPocket | old/Original/_Config.h | <filename>old/Original/_Config.h<gh_stars>0
#ifndef __neoPocketConf
#define __neoPocketConf
#define ANIM_COLOR 0x2 // Bitwise combination of RGB for color of the theme
#define NUM_PIXELS 20
#define PIN_BIGPP 0 // Turns on on LOW
#define PIN_RAND 1
#define PIN_CHARGE_EN 2 // > 0A when charged
#define PIN_INTERRUPT... |
Jasdoge/NeoPocket | MiniPocket/_Config.h | <reponame>Jasdoge/NeoPocket
#ifndef __neoPocketConf
#define __neoPocketConf
const uint32_t KEEPALIVE_DURATION = 10000; //150000; // Use ON_DUR
const uint32_t FADE_TIME = 10000; // This is appended to KEEPALIVE_DURATION
#define ON_DUR (KEEPALIVE_DURATION+FADE_TIME)
const uint16_t MAX_BRIGHTNESS = 255;
#define PIN_I... |
Jasdoge/NeoPocket | old/Original/Animations.h | <gh_stars>0
#ifndef __NP_Animations
#define __NP_Animations
#include "_Config.h"
#include <tinyNeoPixel_Static.h>
namespace npAnim{
// Brightness mode for conf
uint8_t mode = 1; // Sets the brightness level. 1 is default. Use a const below
const uint8_t BRIGHTNESS_HIGH = 2;
const uint8_t BRIGHTNESS_ME... |
Jasdoge/NeoPocket | NeoPocket/Consts.h | <reponame>Jasdoge/NeoPocket<filename>NeoPocket/Consts.h
#ifndef __neoPocketConf
#define __neoPocketConf
// Debug settings
//#define DEBUG_IGNORE_BATTERY
#define NUM_PIXELS 20
const uint16_t BATTERY_THR = 740; // when below this value, battery is considered low
const float KEEPALIVE_THRESH = 3.0; // Threshold to... |
Jasdoge/NeoPocket | AnimBuilder/Animator.h | <gh_stars>0
#ifndef __NP_Animations
#define __NP_Animations
#include "Consts.h"
#include <tinyNeoPixel_Static.h>
namespace Animator{
// Shared vars
uint8_t pixelBuffer[NUM_PIXELS*3] = {0};
float fadePerc = 1; // Fades from 1 to 0 (on to off)
// Timers that can be used by the animation
uint32_t timer_a;
uint1... |
heiglandreas/ldapi | src/valuelist.c | <reponame>heiglandreas/ldapi
/*
* Copyright <NAME> <<EMAIL>>
*
* This file is published under the MIT License. For more details see the file LICENSE.md
*/
#include "../php_ldapi.h"
#define PHP_LDAPI_VALUELIST_CLASS_NAME "ValueList"
static zend_class_entry *php_ldapi_valuelist_class_entry;
/**
* @param Value v... |
heiglandreas/ldapi | src/attribute.c | /*
* Copyright <NAME> <<EMAIL>>
*
* This file is published under the MIT License. For more details see the file LICENSE.md
*/
#include "../php_ldapi.h"
#define PHP_LDAPI_ATTRIBUTE_CLASS_NAME "Attribute"
static zend_class_entry *php_ldapi_attribute_class_entry;
/**
* @param string attributename
*
* @return b... |
heiglandreas/ldapi | php_ldapi.h | <filename>php_ldapi.h
#ifndef PHP_LDAPI_H
#define PHP_LDAPI_H
#include <ldap.h>
#define PHP_LDAPI_EXT_NAME "ldapi"
#define PHP_LDAPI_EXT_VERSION "0.0.1"
#define PHP_LDAPI_EXT_NS "Ldapi"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */
#include <php.h>
#ifdef ZTS
#include "TSRM.h"
#endif
#if d... |
heiglandreas/ldapi | src/search.c | <reponame>heiglandreas/ldapi
/*
* Copyright <NAME> <<EMAIL>>
*
* This file is published under the MIT License. For more details see the file LICENSE.md
*/
#include "../php_ldapi.h"
#define PHP_LDAPI_SEARCH_CLASS_NAME "Search"
static zend_class_entry *php_ldapi_search_class_entry;
/**
* @param Dn baseDn
*... |
heiglandreas/ldapi | src/dnlist.c | <gh_stars>1-10
/*
* Copyright <NAME> <<EMAIL>>
*
* This file is published under the MIT License. For more details see the file LICENSE.md
*/
#include "../php_ldapi.h"
#define PHP_LDAPI_DNLIST_CLASS_NAME "DnList"
static zend_class_entry *php_ldapi_dnlist_class_entry;
/**
* @param string dnOrUsername
* @param ... |
heiglandreas/ldapi | ldapi.c | #include "php_ldapi.h"
#include "src/ldap.c"
#include "src/search.c"
#include "src/option.c"
#include "src/entrylist.c"
#include "src/entry.c"
#include "src/dnlist.c"
#include "src/dn.c"
#include "src/attribute.c"
#include "src/attributelist.c"
#include "src/value.c"
#include "src/valuelist.c"
PHP_MINIT_FUNCTION(l... |
heiglandreas/ldapi | src/entrylist.c | /*
* Copyright <NAME> <<EMAIL>>
*
* This file is published under the MIT License. For more details see the file LICENSE.md
*/
#include "../php_ldapi.h"
#define PHP_LDAPI_ENTRYLIST_CLASS_NAME "EntryList"
static zend_class_entry *php_ldapi_entrylist_class_entry;
/**
* @return void
*/
PHP_METHOD(ldapi_entrylist... |
heiglandreas/ldapi | src/entry.c | /*
* Copyright <NAME> <<EMAIL>>
*
* This file is published under the MIT License. For more details see the file LICENSE.md
*/
#include "../php_ldapi.h"
#define PHP_LDAPI_ENTRY_CLASS_NAME "Entry"
static zend_class_entry *php_ldapi_entry_class_entry;
/**
* @param Dn dn
*
* @return bool
*/
PHP_METHOD(ldapi_en... |
heiglandreas/ldapi | src/attributelist.c | /*
* Copyright <NAME> <<EMAIL>>
*
* This file is published under the MIT License. For more details see the file LICENSE.md
*/
#include "../php_ldapi.h"
#define PHP_LDAPI_ATTRIBUTELIST_CLASS_NAME "AttributeList"
static zend_class_entry *php_ldapi_attributelist_class_entry;
/**
* @param Attribute attribute
*
... |
heiglandreas/ldapi | src/ldap.c | /*
* Copyright <NAME> <<EMAIL>>
*
* This file is published under the MIT License. For more details see the file LICENSE.md
*/
#include "../php_ldapi.h"
#define PHP_LDAPI_LDAP_CLASS_NAME "Ldap"
static zend_class_entry *php_ldapi_ldap_class_entry;
/**
* @param string dnOrUsername
* @param string password
*
*... |
heiglandreas/ldapi | src/value.c | /*
* Copyright <NAME> <<EMAIL>>
*
* This file is published under the MIT License. For more details see the file LICENSE.md
*/
#include "../php_ldapi.h"
#define PHP_LDAPI_VALUE_CLASS_NAME "Value"
static zend_class_entry *php_ldapi_value_class_entry;
/**
* @param mixed value
*
* @return void
*/
PHP_METHOD(ld... |
heiglandreas/ldapi | src/option.c | /*
* Copyright <NAME> <<EMAIL>>
*
* This file is published under the MIT License. For more details see the file LICENSE.md
*/
#include "../php_ldapi.h"
#define PHP_LDAPI_OPTION_CLASS_NAME "Option"
static zend_class_entry *php_ldapi_option_class_entry;
/**
* @param string value
* @param mixed value
*
* @ret... |
heiglandreas/ldapi | src/dn.c | <reponame>heiglandreas/ldapi<filename>src/dn.c
/*
* Copyright <NAME> <<EMAIL>>
*
* This file is published under the MIT License. For more details see the file LICENSE.md
*/
#include "../php_ldapi.h"
#define PHP_LDAPI_DN_CLASS_NAME "Dn"
static zend_class_entry *php_ldapi_dn_class_entry;
/**
* @param string dnO... |
Enrico192002/EserciziC | 20211214/fatt.c | <gh_stars>0
#include "fatt.h"
unsigned long long int fatt(unsigned long long int h) {
if(n==1) {
return 1;
} else {
return(n * fatt(n-1>L))
}
}
|
Enrico192002/EserciziC | math_api/quiz.h | # ifndef __QUIZ_H__
# definisci __QUIZ_H__
int quiz ( int x, int y);
# endif
|
Enrico192002/EserciziC | tabella_cyrillic.c | /*
bash-5.1$ gcc -o cyril tabella_cyrillic.c converti_api.c
bash-5.1$ cyril
|0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F|
|---|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
|41_|А|Б|В|Г|Д|Е|Ж|З|И|Й|К|Л|М|Н|О|П|
|42_|Р|С|Т|У|Ф|Х|Ц|Ч|Ш|Щ|Ъ|Ы|Ь|Э|Ю|Я|
|43_|а|б|в|г|д|е|ж|з|и|й|к|л|м|н|о|п|
|44_|р|с|т|у|ф|х|ц|ч|ш|щ|ъ|ы|ь|э|ю|я|
*/
#include <s... |
Enrico192002/EserciziC | 20211214/fatt.h | int fatt(unsigned long long int n);
|
Enrico192002/EserciziC | tabella_emoticons.c | /*
U+1F600..U+1F64F
*/
#include <stdio.h>
#include <stdlib.h>
#include "converti_api.h"
int main(int argc, char *argv[]) {
char risultato[9];
for (int r = 8032; r < 8037; r++) {
printf("|%X_", r);
for (int c = 0; c < 16; c++) {
char emoticon[6];
sprintf(emoticon, "%5.5X", 16 * r + c)... |
Enrico192002/EserciziC | converti_api.c | /*
Autore: <NAME> (2021)
nell'ambito di: FONDAMENTI DI PROGRAMMAZIONE
ITS "Magento & e-commerce software"
*/
#include <stdio.h>
#include <stdlib.h>
#include "converti_api.h"
static union { char c[8]; unsigned long a_long; } test = { { 'l','?', '?... |
phma/plytapus | plytapus/plytapus.h | #pragma once
#include <vector>
#include <array>
#include <map>
#include <unordered_map>
#include <type_traits>
#include <cassert>
#include <memory>
#include <functional>
#ifdef PLYTAPUS_BEING_BUILT
#include "config.h"
#include "textio.h"
#else
#include <plytapus/config.h>
#include <plytapus/textio.h>
#endif
#ifndef ... |
sbremer/dwm | config.h | /* See LICENSE file for copyright and license details. */
#include <X11/XF86keysym.h>
/* appearance */
static const unsigned int borderpx = 0; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const unsigned int systraypinning = 0; /* 0: sloppy systray fo... |
Dani-24/SDL_Platformer | SDL_Platformer/Game/Source/Player.h | #ifndef __PLAYER_H__
#define __PLAYER_H__
#include "Module.h"
#include "App.h"
#include "Animation.h"
#include "List.h"
#include "Point.h"
#define MaxShoots 3
struct SDL_Texture;
struct Collider;
class Player : public Module
{
public:
// Constructor
Player(App* application, bool start_enabled);
// Destructor
~P... |
Dani-24/SDL_Platformer | SDL_Platformer/Game/Source/GuiCheckBox.h | <gh_stars>1-10
#ifndef __GUICHECKBOX_H__
#define __GUICHECKBOX_H__
#include "GuiControl.h"
#include "Point.h"
#include "SString.h"
class GuiCheckBox : public GuiControl
{
public:
GuiCheckBox(uint32 id, SDL_Rect bounds, const char* text);
virtual ~GuiCheckBox();
bool Update(float dt);
bool Draw(Render* render);... |
Dani-24/SDL_Platformer | SDL_Platformer/Game/Source/Module.h | #ifndef __MODULE_H__
#define __MODULE_H__
#include "SString.h"
#include "PugiXml/src/pugixml.hpp"
class App;
class PhysBody;
class GuiControl;
class Module
{
public:
SString name;
bool active = true;
public:
App* Application;
Module(App* parent, bool startEnabled) : Application(parent), active(startEnabled)
... |
Dani-24/SDL_Platformer | SDL_Platformer/Game/Source/Timer.h | <reponame>Dani-24/SDL_Platformer
#ifndef __TIMER_H__
#define __TIMER_H__
#include "Defs.h"
class Timer
{
public:
// Constructor
Timer();
void Start();
void Stop();
uint32 Read() const;
float ReadSec() const;
private:
uint32 startTime;
uint stopTime;
bool running;
};
#endif //__TIMER_H__ |
Dani-24/SDL_Platformer | SDL_Platformer/Game/Source/FadeToBlack.h | #pragma once
#ifndef __FADETOBLACK_H__
#define __FADETOBLACK_H__
#include "Module.h"
#include "External/SDL/include/SDL_rect.h"
class FadeToBlack : public Module
{
public:
FadeToBlack(App* application, bool start_enabled = true);
~FadeToBlack();
bool Start();
bool Update(float dt);
bool PostUpdate();
//call ... |
Dani-24/SDL_Platformer | SDL_Platformer/Game/Source/Scene.h | <reponame>Dani-24/SDL_Platformer
#ifndef __SCENE_H__
#define __SCENE_H__
#include "Module.h"
#include "Animation.h"
#include "GuiButton.h"
#include "GuiCheckBox.h"
#define Scroller 5
struct SDL_Texture;
class Scene : public Module
{
public:
Scene(App* application, bool start_enabled = true);
virtual ~Scene();
... |
Dani-24/SDL_Platformer | SDL_Platformer/Game/Source/Physics.h | #ifndef __PHYSICS_H__
#define __PHYSICS_H__
#include "Module.h"
#include "Box2D/Box2D/Box2D.h"
#include "Log.h"
#define DEGTORAD 0.0174532925199432957f
#define RADTODEG 57.295779513082320876f
#define GRAVITY_X 0.0f
#define GRAVITY_Y -7.0f
#define PIXELS_PER_METER 50.0f // if touched change METER_PER_PIXEL too
#defi... |
Dani-24/SDL_Platformer | SDL_Platformer/Game/Source/Enemy.h | <reponame>Dani-24/SDL_Platformer<filename>SDL_Platformer/Game/Source/Enemy.h
#ifndef __ENEMY_H__
#define __ENEMY_H__
#include "Module.h"
#include "App.h"
#include "Animation.h"
#include "List.h"
#include "Point.h"
//(Look out for yourself..!)
//I wake up to the sounds of the silence that allows
//For my mind to run a... |
Dani-24/SDL_Platformer | SDL_Platformer/Game/Source/SceneTitle.h | <filename>SDL_Platformer/Game/Source/SceneTitle.h
#ifndef __SCENETITLE_H__
#define __SCENETITLE_H__
#include "Module.h"
#include "GuiButton.h"
#include "GuiCheckBox.h"
struct SDL_Texture;
class SceneTitle : public Module
{
public:
SceneTitle(App* application, bool start_enabled = true);
// Destructor
virtual ~S... |
Dani-24/SDL_Platformer | SDL_Platformer/Game/Source/SceneLogo.h | #ifndef __SCENELOGO_H__
#define __SCENELOGO_H__
#include "Module.h"
struct SDL_Texture;
class SceneLogo : public Module
{
public:
SceneLogo(App* application, bool start_enabled = true);
// Destructor
virtual ~SceneLogo();
// Called before render is available
bool Awake();
// Called before the first frame
... |
cmesias/FattestBossFightEver | src/Game/Tiles.h | /*
* Tile.h
*
* Created on: Jan 16, 2017
* Author: Carl
*/
#ifndef LOCAL_TILES_H_
#define LOCAL_TILES_H_
#include "../LWindow.h"
#include "../LTexture.h"
#include "../Helper.h"
class Tile: public Helper {
public:
/* Tile Variables */
const int max = 5000;
int tileCount = 0;
int multiW = 1;
int multi... |
cmesias/FattestBossFightEver | src/PlayGame.h | /*
* PlayGame.h
*
* Created on: May 15, 2017
* Author: Carl
*/
#ifndef PLAYGAME_H_
#define PLAYGAME_H_
#include "Game/Boss.h"
#include "Game/Enemies.h"
#include "Game/Maps.h"
#include "Game/Players.h"
#include "Game/Spawners.h"
#include "Game/Object.h"
#include "Game/TileBar.h"
#include "Game/Tiles.h"
#inc... |
cmesias/FattestBossFightEver | src/Game/Monster.h | <reponame>cmesias/FattestBossFightEver
/*
* Monster.h
*
* Created on: Jul 21, 2017
* Author: Carl
*/
#ifndef GAME_MONSTER_H_
#define GAME_MONSTER_H_
class Monster {
public:
float x2, y2;
int radius;
float x,y,w,h;
float angle;
float angleFacingTarget;
float vX,vY;
float speed;
int type;
float hea... |
cmesias/FattestBossFightEver | src/Bar.h | <gh_stars>0
/*
* Bar.h
*
* Created on: Apr 28, 2017
* Author: Carl
*/
#ifndef BAR_H_
#define BAR_H_
#include "LTexture.h"
#include <sstream>
struct Bar {
public:
int x; // x position of bar
int y; // y position of bar
int width; // bar width
int height; // bar height
int color[3]; // bar c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.