Skip to content

Commit

Permalink
Official Woopsa Embedded release!
Browse files Browse the repository at this point in the history
- [Feature] Woopsa Embedded is considered stable and working
- [Feature] Woopsa Embedded samples available for UNIX/Linux/Windows and Arduino
- [Enhancement] Removed useless username/password in JavaScript demo
  • Loading branch information
floriansegginger committed Nov 26, 2015
1 parent 4f7181a commit ab46bc0
Show file tree
Hide file tree
Showing 18 changed files with 2,093 additions and 23 deletions.
Binary file modified Release/DotNet/WoopsaDemoServer.exe
Binary file not shown.
47 changes: 47 additions & 0 deletions Release/Embedded/woopsa-config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#ifndef __WOOPSA_CONFIG_H_
#define __WOOPSA_CONFIG_H_

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>


// Woopsa uses these internally, allowing you to use Woopsa in a
// thread-safe manner, or disabling interrupts. Just fill this in
// if needed with whatever locking mechanism your environment has.
#define WOOPSA_LOCK // disable interrupts
#define WOOPSA_UNLOCK // enable interrupts

// If you are on a system with very low memory, you can reduce the
// buffer size that the Woopsa server uses internally.
// This value changes the maximum length of URLs you can parse.
// You should not go under 128 bytes to be 100% safe.
#define WOOPSA_BUFFER_SIZE 256

// Thanks microsoft for not supporting snprintf!
#if defined(_MSC_VER) && _MSC_VER < 1900
#define snprintf _snprintf
#endif

#define WOOPSA_ENABLE_STRINGS
#define WOOPSA_ENABLE_METHODS

// 99% of systems will have the standard C library but in case
// you end up in the 1%, you can always re-define these functions
// to work for you.
#define WOOPSA_INTEGER_TO_PADDED_STRING(value, string, padding) sprintf(string, "%" #padding "d", value)
#define WOOPSA_INTEGER_TO_STRING(value, string, max_length) snprintf(string, max_length, "%d", value)
#define WOOPSA_REAL_TO_STRING(value, string, max_length) snprintf(string, max_length, "%f", value)

#define WOOPSA_STRING_TO_INTEGER(value, string) (value = atoi(string))
#define WOOPSA_STRING_TO_FLOAT(value, string) (value = atof(string))

#define WOOPSA_STRING_POSITION(haystack, needle) strstr(haystack, needle)
#define WOOPSA_STRING_EQUAL(string1, string2) (strcmp(string1, string2) == 0)
#define WOOPSA_STRING_LENGTH(string) strlen(string)
#define WOOPSA_CHAR_TO_LOWER(character) tolower(character)
#define WOOPSA_STRING_COPY(destination, source) strcpy(destination, source)
#define WOOPSA_STRING_N_COPY(destination, source, n) strncpy(destination, source, n)

#endif
Loading

0 comments on commit ab46bc0

Please sign in to comment.