Skip to content

Commit

Permalink
Add OC_API annotations to port/oc_storage.h
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielius1922 committed Sep 27, 2024
1 parent be6eb62 commit ad35db6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
3 changes: 3 additions & 0 deletions include/oc_sp.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#ifndef OC_SP_H
#define OC_SP_H

#include "oc_export.h"

#include <stddef.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -126,6 +128,7 @@ typedef enum {
* @param[in] mfg_credid the credential ID of the /oic/sec/cred entry containing
* the manufactures end-entity certificate
*/
OC_API
void oc_pki_set_security_profile(size_t device, unsigned supported_profiles,
oc_sp_types_t current_profile, int mfg_credid);

Expand Down
21 changes: 14 additions & 7 deletions port/oc_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#ifndef OC_PORT_STORAGE_H
#define OC_PORT_STORAGE_H

#include "oc_export.h"
#include "util/oc_compiler.h"

#include <stddef.h>
#include <stdint.h>

Expand All @@ -31,32 +34,36 @@ extern "C" {
/**
* @brief open the storage
*
* @param store the storage path (cannot be NULL)
* @param store the storage path
* @return 0 on success
* @return <0 on failure
*/
OC_API
int oc_storage_config(const char *store);

/**
* @brief read from the storage
*
* @param store the path to be read
* @param buf the buffer to store the contents
* @param store the path to be read (cannot be NULL)
* @param buf the buffer to store the contents (cannot be NULL)
* @param size amount of bytes to read
* @return long amount of bytes read
*/
long oc_storage_read(const char *store, uint8_t *buf, size_t size);
OC_API
long oc_storage_read(const char *store, uint8_t *buf, size_t size) OC_NONNULL();

/**
* @brief write to storage
*
* @param store the store (file path)
* @param buf the buffer to write
* @param store the store (file path, cannot be NULL)
* @param buf the buffer to write (cannot be NULL)
* @param size the size of the buffer to write
* @return long >= 0 amount of bytes written on success
* @return long < 0 on failure
*/
long oc_storage_write(const char *store, const uint8_t *buf, size_t size);
OC_API
long oc_storage_write(const char *store, const uint8_t *buf, size_t size)
OC_NONNULL();

#ifdef __cplusplus
}
Expand Down

0 comments on commit ad35db6

Please sign in to comment.