aboutsummarylogtreecommitdiffstats
path: root/api.h
diff options
context:
space:
mode:
authorAntony Kellermann2018-07-27 08:29:47 -0400
committerAntony Kellermann2018-07-27 08:29:47 -0400
commit4f1f9235d7766d71de283630428d75d92712f4cc (patch)
treecd9ba07054c27481b8703da1cb4eed7e3583dd80 /api.h
parent6ea794133608437818891fbe452380eb4a045a8a (diff)
downloadaur-4f1f9235d7766d71de283630428d75d92712f4cc.tar.gz
Added ref data struct
Diffstat (limited to 'api.h')
-rw-r--r--api.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/api.h b/api.h
index 7f154f0e6727..9a21953906d8 100644
--- a/api.h
+++ b/api.h
@@ -12,6 +12,7 @@
#define DATE_MAX_LENGTH 16
#define CELL_MAX_LENGTH 16
#define SYMBOL_MAX_LENGTH 32
+#define NAME_MAX_LENGTH 128
#define URL_MAX_LENGTH 2048
#define INFO_TEXT_MAX 2048
#define EMPTY (-999)
@@ -24,6 +25,12 @@
#include <pthread.h>
#include "utils.h"
+typedef struct ref_data {
+ char** symbols;
+ char** names;
+ size_t length;
+} Ref_Data;
+
typedef struct news_article {
char headline[INFO_TEXT_MAX];
char source[INFO_TEXT_MAX];
@@ -129,6 +136,8 @@ struct info_array {
Info* totals;
};
+Ref_Data* api_ref_data_init_from_length(size_t length);
+
/**
* Allocates a News struct and returns a pointer to it.
* @return News*
@@ -324,7 +333,13 @@ void info_array_store_totals(Info_Array* pInfo_Array);
* Returns a pointer to an Info_Array containing a list of all iex listed securities.
* @return Info_Array*
*/
-Info_Array* iex_get_valid_symbols(void);
+Ref_Data* iex_get_valid_symbols(void);
+
+/**
+ * Destroys Ref_Data object and frees memory. Sets the pointer of the Ref_Data to NULL
+ * @param phRef_Data the Ref_Data to destroy
+ */
+void api_ref_data_destroy(Ref_Data** phRef_Data);
/**
* Destroys News object and frees memory. Sets the pointer of the News to NULL