Skip to content

Commit 8eefe43

Browse files
committed
[4.0.0] Make all functions return sucess status
This is a breaking change for appkeys and hashing functions, hence version bump.
1 parent f1d3210 commit 8eefe43

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+117
-99
lines changed

Changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
## [Unreleased]
44

5+
## [4.0.0] - 2024-05-06
6+
7+
Breaking Changes
8+
9+
- [appkey] Update signature of appkey functions to return bool instead of uint8_t
10+
- [appkey] Change return values of appkey to indicate SUCCESS status to be consistent with other functions
11+
- [hashing] All hashing/base64 functions have been updated similarly to return bool status of success instead of error
12+
513
## [3.0.4] - 2024-05-05
614

715
- [apple2] Add appkey support (thanks Eric Carr)

apple2/src/fn_fuji/fuji_appkey_open.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
#include "fujinet-fuji.h"
33
#include "fujinet-bus-apple2.h"
44

5-
uint8_t fuji_appkey_open(AppKeyOpen *buffer)
5+
// Open app-key, returns error status
6+
bool fuji_appkey_open(AppKeyOpen *buffer)
67
{
78
sp_error = sp_get_fuji_id();
89
if (sp_error <= 0) {

apple2/src/fn_fuji/fuji_appkey_read.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
#include "fujinet-fuji.h"
44
#include "fujinet-bus-apple2.h"
55

6-
uint8_t fuji_appkey_read(AppKeyRead *buffer)
6+
// reads the app-key, returns error status
7+
bool fuji_appkey_read(AppKeyRead *buffer)
78
{
89
sp_error = sp_get_fuji_id();
910
if (sp_error <= 0) {

apple2/src/fn_fuji/fuji_appkey_write.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
#include "fujinet-bus-apple2.h"
44
#include <string.h>
55

6-
uint8_t fuji_appkey_write(uint16_t count, AppKeyWrite *buffer)
6+
// writes app-key, returns error status
7+
bool fuji_appkey_write(uint16_t count, AppKeyWrite *buffer)
78
{
89
sp_error = sp_get_fuji_id();
9-
1010
if (sp_error <= 0) {
1111
return false;
1212
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <stdint.h>
22
#include "fujinet-fuji.h"
33

4-
uint8_t fuji_base64_decode_compute()
4+
bool fuji_base64_decode_compute()
55
{
6-
return 1;
6+
return true;
77
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <stdint.h>
22
#include "fujinet-fuji.h"
33

4-
uint8_t fuji_base64_decode_input(char *s, uint16_t len)
4+
bool fuji_base64_decode_input(char *s, uint16_t len)
55
{
6-
return 1;
6+
return true;
77
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <stdint.h>
22
#include "fujinet-fuji.h"
33

4-
uint8_t fuji_base64_decode_length(unsigned long *len)
4+
bool fuji_base64_decode_length(unsigned long *len)
55
{
6-
return 1;
6+
return true;
77
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <stdint.h>
22
#include "fujinet-fuji.h"
33

4-
uint8_t fuji_base64_decode_output(char *s, uint16_t len)
4+
bool fuji_base64_decode_output(char *s, uint16_t len)
55
{
6-
return 1;
6+
return true;
77
}

apple2/src/fn_fuji/fuji_base64_encode_compute.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
#include "fujinet-fuji.h"
44
#include "fujinet-bus-apple2.h"
55

6-
uint8_t fuji_base64_encode_compute()
6+
bool fuji_base64_encode_compute()
77
{
88
// send CTRL command: 0xCF
99
// PAYLOAD: N/A
1010

11-
return sp_control(0, 0xCF);
11+
return sp_control(0, 0xCF) == 0;
1212
}

apple2/src/fn_fuji/fuji_base64_encode_input.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "fujinet-fuji.h"
55
#include "fujinet-bus-apple2.h"
66

7-
uint8_t fuji_base64_encode_input(char *s, uint16_t len)
7+
bool fuji_base64_encode_input(char *s, uint16_t len)
88
{
99
// send CTRL command: 0xD0
1010
// PAYLOAD:
@@ -13,6 +13,6 @@ uint8_t fuji_base64_encode_input(char *s, uint16_t len)
1313

1414
if (len > MAX_DATA_LEN) return 1;
1515
strncpy(sp_payload, s, len);
16-
return sp_control(0, 0xD0);
16+
return sp_control(0, 0xD0) == 0;
1717

1818
}

0 commit comments

Comments
 (0)