This file contains hidden or 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
| #!/bin/bash | |
| OS=`uname` | |
| if [ "$OS" == "Darwin" ]; then | |
| echo "Building with Clang" | |
| COMPILER=clang | |
| else | |
| echo "Building with GCC" | |
| COMPILER=gcc | |
| fi | |
| function echo_red() |
This file contains hidden or 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 <pthread.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #define NUM_THREADS 3 | |
| #define TCOUNT 10 | |
| #define COUNT_LIMIT 12 | |
| int count = 0; |
This file contains hidden or 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
| /* | |
| * ===================================================================================== | |
| * | |
| * Filename: jnxguid.c | |
| * | |
| * Description: | |
| * | |
| * Version: 1.0 | |
| * Created: 26/01/2015 21:16:23 | |
| * Revision: none |
This file contains hidden or 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 <stdio.h> | |
| int main() { | |
| uint8_t guid[16] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; | |
| size_t size = sizeof guid; | |
| char dbuffy[49] = {}; | |
| for (int j = 0; j < size; j++) { |
This file contains hidden or 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
| // If you have two functions that traverse the list in slightly | |
| // different manner | |
| // | |
| // First function: | |
| void traverse_1(list *A) { | |
| list *head = A->head; | |
| while (A->head != NULL) | |
| A->head = A->head->next; | |
| A->head = head; | |
| } |
This file contains hidden or 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
| uint8_t* jnx_encoder_b64_encode(jnx_encoder *e,uint8_t *data, size_t input_length, size_t *output_length) { | |
| JNXCHECK(data); | |
| JNXCHECK(input_length); | |
| *output_length = 4 * ((input_length + 2) / 3); | |
| uint8_t *encoded_data = malloc(((*output_length) +1) * sizeof (char)); | |
| if (encoded_data == NULL) return NULL; | |
| int i,j; | |
| for ( i = 0, j = 0; i < input_length; i += 3) { |