aspe:keyoxide.org:XD6KNWYFFLMX32D2ZSXWMI6VZA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <string.h> | |
#include "stack.h" | |
Stack *stack_new(Stack *st, size_t size, bool (*equals)(const void*, const void*)) | |
{ | |
if (size <= 0) return NULL; | |
st->idx = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <string.h> | |
#include "queue.h" | |
Queue *queue_new(Queue *q, size_t size, bool (*equals)(const void*, const void*)) | |
{ | |
if (size <= 0) return NULL; | |
q->data = malloc((size+1)* sizeof(*q->data), false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
** Compile in terminal with the following line: | |
** clang main.m -framework Foundation -framework Metal -o TestMetal | |
*/ | |
#import <Foundation/Foundation.h> | |
#import <Metal/Metal.h> | |
int main(void) { | |
@autoreleasepool { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The MIT License (MIT) | |
Copyright (c) 2016 by António Sarmento | |
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, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |