Renamed tox-weechat-json to -data.
This commit is contained in:
parent
e02d2c9b0e
commit
06e7747142
@ -41,7 +41,7 @@ add_library(tox MODULE
|
|||||||
src/tox-weechat-gui.c
|
src/tox-weechat-gui.c
|
||||||
src/tox-weechat-utils.c
|
src/tox-weechat-utils.c
|
||||||
src/tox-weechat-config.c
|
src/tox-weechat-config.c
|
||||||
src/tox-weechat-json.c
|
src/tox-weechat-data.c
|
||||||
src/tox-weechat-completion.c
|
src/tox-weechat-completion.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include "tox-weechat-friend-requests.h"
|
#include "tox-weechat-friend-requests.h"
|
||||||
#include "tox-weechat-utils.h"
|
#include "tox-weechat-utils.h"
|
||||||
|
|
||||||
#include "tox-weechat-json.h"
|
#include "tox-weechat-data.h"
|
||||||
|
|
||||||
#define TOX_WEECHAT_JSON_CONFIG_PATH "%h/tox/data.json"
|
#define TOX_WEECHAT_JSON_CONFIG_PATH "%h/tox/data.json"
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ tox_weechat_json_get_identity_key(struct t_tox_weechat_identity *identity)
|
|||||||
* Save an identity's data.
|
* Save an identity's data.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
tox_weechat_json_identity_save(struct t_tox_weechat_identity *identity)
|
tox_weechat_data_identity_save(struct t_tox_weechat_identity *identity)
|
||||||
{
|
{
|
||||||
json_t *json_data = json_object();
|
json_t *json_data = json_object();
|
||||||
json_t *friend_request_array = json_array();
|
json_t *friend_request_array = json_array();
|
||||||
@ -114,7 +114,7 @@ tox_weechat_json_identity_save(struct t_tox_weechat_identity *identity)
|
|||||||
* Load an identity's data from a JSON object.
|
* Load an identity's data from a JSON object.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
tox_weechat_json_identity_load(struct t_tox_weechat_identity *identity)
|
tox_weechat_data_identity_load(struct t_tox_weechat_identity *identity)
|
||||||
{
|
{
|
||||||
char *identity_key = tox_weechat_json_get_identity_key(identity);
|
char *identity_key = tox_weechat_json_get_identity_key(identity);
|
||||||
json_t *identity_data = json_object_get(tox_weechat_json_data, identity_key);
|
json_t *identity_data = json_object_get(tox_weechat_json_data, identity_key);
|
||||||
@ -150,10 +150,10 @@ tox_weechat_json_identity_load(struct t_tox_weechat_identity *identity)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the JSON data on disk into memory.
|
* Load the data on disk into memory.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
tox_weechat_json_load()
|
tox_weechat_data_load()
|
||||||
{
|
{
|
||||||
char *full_path = tox_weechat_json_data_file_path();
|
char *full_path = tox_weechat_json_data_file_path();
|
||||||
|
|
||||||
@ -173,11 +173,11 @@ tox_weechat_json_load()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save all in-memory data to JSON data on disk. Return 0 on success, -1 on
|
* Save all in-memory data to data on disk. Return 0 on success, -1 on
|
||||||
* error.
|
* error.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
tox_weechat_json_save()
|
tox_weechat_data_save()
|
||||||
{
|
{
|
||||||
char *full_path = tox_weechat_json_data_file_path();
|
char *full_path = tox_weechat_json_data_file_path();
|
||||||
int rc = json_dump_file(tox_weechat_json_data,
|
int rc = json_dump_file(tox_weechat_json_data,
|
||||||
@ -192,7 +192,7 @@ tox_weechat_json_save()
|
|||||||
* Free in-memory JSON data.
|
* Free in-memory JSON data.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
tox_weechat_json_free()
|
tox_weechat_data_free()
|
||||||
{
|
{
|
||||||
json_decref(tox_weechat_json_data);
|
json_decref(tox_weechat_json_data);
|
||||||
}
|
}
|
@ -17,30 +17,28 @@
|
|||||||
* along with Tox-WeeChat. If not, see <http://www.gnu.org/licenses/>.
|
* along with Tox-WeeChat. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TOX_WEECHAT_JSON_H
|
#ifndef TOX_WEECHAT_DATA_H
|
||||||
#define TOX_WEECHAT_JSON_H
|
#define TOX_WEECHAT_DATA_H
|
||||||
|
|
||||||
#include "tox-weechat-identities.h"
|
struct t_tox_weechat_identity;
|
||||||
|
|
||||||
extern const char *tox_weechat_json_key_friend_requests;
|
extern const char *tox_weechat_data_key_friend_requests;
|
||||||
extern const char *tox_weechat_json_friend_request_key_client_id;
|
extern const char *tox_weechat_data_friend_request_key_client_id;
|
||||||
extern const char *tox_weechat_json_friend_request_key_message;
|
extern const char *tox_weechat_data_friend_request_key_message;
|
||||||
|
|
||||||
struct json_t;
|
|
||||||
|
|
||||||
void
|
void
|
||||||
tox_weechat_json_load();
|
tox_weechat_data_load();
|
||||||
|
|
||||||
void
|
void
|
||||||
tox_weechat_json_identity_save(struct t_tox_weechat_identity *identity);
|
tox_weechat_data_identity_save(struct t_tox_weechat_identity *identity);
|
||||||
|
|
||||||
void
|
void
|
||||||
tox_weechat_json_identity_load(struct t_tox_weechat_identity *identity);
|
tox_weechat_data_identity_load(struct t_tox_weechat_identity *identity);
|
||||||
|
|
||||||
int
|
int
|
||||||
tox_weechat_json_save();
|
tox_weechat_data_save();
|
||||||
|
|
||||||
void
|
void
|
||||||
tox_weechat_json_free();
|
tox_weechat_data_free();
|
||||||
|
|
||||||
#endif // TOX_WEECHAT_JSON_H
|
#endif // TOX_WEECHAT_DATA_H
|
@ -34,7 +34,7 @@
|
|||||||
#include "tox-weechat-chats.h"
|
#include "tox-weechat-chats.h"
|
||||||
#include "tox-weechat-tox-callbacks.h"
|
#include "tox-weechat-tox-callbacks.h"
|
||||||
#include "tox-weechat-utils.h"
|
#include "tox-weechat-utils.h"
|
||||||
#include "tox-weechat-json.h"
|
#include "tox-weechat-data.h"
|
||||||
|
|
||||||
#include "tox-weechat-identities.h"
|
#include "tox-weechat-identities.h"
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include "tox-weechat-gui.h"
|
#include "tox-weechat-gui.h"
|
||||||
#include "tox-weechat-friend-requests.h"
|
#include "tox-weechat-friend-requests.h"
|
||||||
#include "tox-weechat-config.h"
|
#include "tox-weechat-config.h"
|
||||||
#include "tox-weechat-json.h"
|
#include "tox-weechat-data.h"
|
||||||
#include "tox-weechat-completion.h"
|
#include "tox-weechat-completion.h"
|
||||||
|
|
||||||
#include "tox-weechat.h"
|
#include "tox-weechat.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user