Skip to content

Commit

Permalink
0.0.10 release
Browse files Browse the repository at this point in the history
  • Loading branch information
s-m-e committed Mar 23, 2018
2 parents 4686180 + d89fc30 commit 24451a8
Show file tree
Hide file tree
Showing 14 changed files with 1,047 additions and 161 deletions.
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changes
=======

0.0.10 (2018-03-23)
-------------------

* FEATURE: Support for functions calculating the length of memory sections in memsync protocol, see issue #33.
* FEATURE: Support for string buffers (and null-terminated strings), see issue #7.
* FIX: Memsync definition sometimes lost information during first call of function, second call subsequently failed, see issue #36.

0.0.9 (2018-03-21)
------------------

Expand Down
113 changes: 113 additions & 0 deletions demo_dll/demo_dll.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,29 @@ void __stdcall DEMODLL bubblesort_struct(
}


void __stdcall DEMODLL bubblesort_segments(
float *a,
int number_of_segments,
int elements_per_segment
)
{
int i, j;
int n = number_of_segments * elements_per_segment;
for (i = 0; i < n - 1; ++i)
{
for (j = 0; j < n - i - 1; ++j)
{
if (a[j] > a[j + 1])
{
float tmp = a[j];
a[j] = a[j + 1];
a[j + 1] = tmp;
}
}
}
}


void __stdcall DEMODLL mix_rgb_colors(
int8_t color_a[3],
int8_t color_b[3],
Expand Down Expand Up @@ -294,6 +317,66 @@ int16_t __stdcall DEMODLL get_const_int(void)
}


void __stdcall DEMODLL replace_letter_in_null_terminated_string_a(
char *in_string,
char old_letter,
char new_letter
)
{
int i;
for (i = 0; i < strlen(in_string); i++) {
if(in_string[i] == old_letter) {
in_string[i] = new_letter;
}
}
}


void __stdcall DEMODLL replace_letter_in_null_terminated_string_b(
char *in_string,
char old_letter,
char new_letter
)
{
int i;
for (i = 0; i < strlen(in_string); i++) {
if(in_string[i] == old_letter) {
in_string[i] = new_letter;
}
}
}


void __stdcall DEMODLL replace_letter_in_null_terminated_string_unicode_a(
wchar_t *in_string,
wchar_t old_letter,
wchar_t new_letter
)
{
int i;
for (i = 0; i < wcslen(in_string); i++) {
if(in_string[i] == old_letter) {
in_string[i] = new_letter;
}
}
}


void __stdcall DEMODLL replace_letter_in_null_terminated_string_unicode_b(
wchar_t *in_string,
wchar_t old_letter,
wchar_t new_letter
)
{
int i;
for (i = 0; i < wcslen(in_string); i++) {
if(in_string[i] == old_letter) {
in_string[i] = new_letter;
}
}
}


float __stdcall DEMODLL simple_demo_routine(
float param_a,
float param_b
Expand Down Expand Up @@ -369,6 +452,36 @@ int16_t __stdcall DEMODLL sum_elements_from_callback_in_struct(
}


int16_t __stdcall DEMODLL use_optional_callback_a(
int16_t in_data,
conveyor_belt process_data
)
{
int16_t tmp;
if(process_data) {
tmp = process_data(in_data);
} else {
tmp = in_data;
}
return tmp * 2;
}


int16_t __stdcall DEMODLL use_optional_callback_b(
int16_t in_data,
conveyor_belt process_data
)
{
int16_t tmp;
if(process_data) {
tmp = process_data(in_data);
} else {
tmp = in_data;
}
return tmp * 2;
}


// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// DLL infrastructure
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Expand Down
40 changes: 40 additions & 0 deletions demo_dll/demo_dll.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ void __stdcall DEMODLL bubblesort_struct(
bubblesort_data *data
);

void __stdcall DEMODLL bubblesort_segments(
float *a,
int number_of_segments,
int elements_per_segment
);

void __stdcall DEMODLL mix_rgb_colors(
int8_t color_a[3],
int8_t color_b[3],
Expand Down Expand Up @@ -161,6 +167,30 @@ int16_t __stdcall DEMODLL pow_ints(

int16_t __stdcall DEMODLL get_const_int(void);

void __stdcall DEMODLL replace_letter_in_null_terminated_string_a(
char *in_string,
char old_letter,
char new_letter
);

void __stdcall DEMODLL replace_letter_in_null_terminated_string_b(
char *in_string,
char old_letter,
char new_letter
);

void __stdcall DEMODLL replace_letter_in_null_terminated_string_unicode_a(
wchar_t *in_string,
wchar_t old_letter,
wchar_t new_letter
);

void __stdcall DEMODLL replace_letter_in_null_terminated_string_unicode_b(
wchar_t *in_string,
wchar_t old_letter,
wchar_t new_letter
);

struct test
{
char el_char;
Expand Down Expand Up @@ -204,6 +234,16 @@ int16_t __stdcall DEMODLL sum_elements_from_callback_in_struct(
struct conveyor_belt_data *data
);

int16_t __stdcall DEMODLL use_optional_callback_a(
int16_t in_data,
conveyor_belt process_data
);

int16_t __stdcall DEMODLL use_optional_callback_b(
int16_t in_data,
conveyor_belt process_data
);


// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// DLL infrastructure
Expand Down
Loading

0 comments on commit 24451a8

Please sign in to comment.