config.c -> cpp

master
Tony Olagbaiye 3 years ago
parent 1dbd8164e1
commit 5c4aaa629c
No known key found for this signature in database
GPG Key ID: 9E2FF3BDEBDFC910

@ -13,7 +13,7 @@
#include "plugin.hh" #include "plugin.hh"
#include "xmpp/stanza.hh" #include "xmpp/stanza.hh"
#include "config.h" #include "config.hh"
#include "input.h" #include "input.h"
#include "omemo.h" #include "omemo.h"
#include "account.h" #include "account.h"

@ -10,7 +10,7 @@
#include <weechat/weechat-plugin.h> #include <weechat/weechat-plugin.h>
#include "plugin.hh" #include "plugin.hh"
#include "config.h" #include "config.hh"
#include "account.h" #include "account.h"
#include "channel.h" #include "channel.h"
#include "user.h" #include "user.h"

@ -10,7 +10,7 @@
#include "plugin.hh" #include "plugin.hh"
#include "account.h" #include "account.h"
#include "config.h" #include "config.hh"
struct t_config_file *config_file; struct t_config_file *config_file;
@ -302,7 +302,7 @@ int config__account_read_cb (const void *pointer, void *data,
if (option_name) if (option_name)
{ {
pos_option = strrchr(option_name, '.'); pos_option = const_cast<char*>(strrchr(option_name, '.'));
if (pos_option) if (pos_option)
{ {
account_name = weechat_strndup(option_name, account_name = weechat_strndup(option_name,

@ -1,57 +0,0 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, version 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef _WEECHAT_XMPP_CONFIG_H_
#define _WEECHAT_XMPP_CONFIG_H_
#define WEECHAT_XMPP_CONFIG_NAME "xmpp"
enum t_config_nick_completion
{
CONFIG_NICK_COMPLETION_SMART_OFF = 0,
CONFIG_NICK_COMPLETION_SMART_SPEAKERS,
CONFIG_NICK_COMPLETION_SMART_SPEAKERS_HIGHLIGHTS,
};
extern struct t_config_file *config_file;
extern struct t_config_section *config_section_account_default;
extern struct t_config_section *config_section_account;
extern struct t_config_option *config_look_nick_completion_smart;
extern struct t_config_option *config_account_default[];
int config__account_check_value_cb(const void *pointer, void *data,
struct t_config_option *option,
const char *value);
void config__account_change_cb(const void *pointer, void *data,
struct t_config_option *option);
struct t_config_option *config__account_new_option (struct t_config_file *config_file,
struct t_config_section *section,
int index_option,
const char *option_name,
const char *default_value,
const char *value,
int null_value_allowed,
int (*callback_check_value)(const void *pointer,
void *data,
struct t_config_option *option,
const char *value),
const void *callback_check_value_pointer,
void *callback_check_value_data,
void (*callback_change)(const void *pointer,
void *data,
struct t_config_option *option),
const void *callback_change_pointer,
void *callback_change_data);
extern int config__init();
extern int config__read();
extern int config__write();
extern void config__free();
#endif /*WEECHAT_XMPP_CONFIG_H*/

@ -0,0 +1,55 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, version 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#pragma once
#define WEECHAT_XMPP_CONFIG_NAME "xmpp"
enum t_config_nick_completion
{
CONFIG_NICK_COMPLETION_SMART_OFF = 0,
CONFIG_NICK_COMPLETION_SMART_SPEAKERS,
CONFIG_NICK_COMPLETION_SMART_SPEAKERS_HIGHLIGHTS,
};
extern struct t_config_file *config_file;
extern struct t_config_section *config_section_account_default;
extern struct t_config_section *config_section_account;
extern struct t_config_option *config_look_nick_completion_smart;
extern struct t_config_option *config_account_default[];
int config__account_check_value_cb(const void *pointer, void *data,
struct t_config_option *option,
const char *value);
void config__account_change_cb(const void *pointer, void *data,
struct t_config_option *option);
struct t_config_option *config__account_new_option (
struct t_config_file *config_file,
struct t_config_section *section,
int index_option,
const char *option_name,
const char *default_value,
const char *value,
int null_value_allowed,
int (*callback_check_value)(const void *pointer,
void *data,
struct t_config_option *option,
const char *value),
const void *callback_check_value_pointer,
void *callback_check_value_data,
void (*callback_change)(const void *pointer,
void *data,
struct t_config_option *option),
const void *callback_change_pointer,
void *callback_change_data);
extern int config__init();
extern int config__read();
extern int config__write();
extern void config__free();

@ -12,9 +12,8 @@
#include <weechat/weechat-plugin.h> #include <weechat/weechat-plugin.h>
#include "plugin.hh" #include "plugin.hh"
#include "diff/diff.h"
#include "xmpp/stanza.hh" #include "xmpp/stanza.hh"
#include "config.h" #include "config.hh"
#include "account.h" #include "account.h"
#include "user.h" #include "user.h"
#include "channel.h" #include "channel.h"
@ -22,6 +21,7 @@
#include "omemo.h" #include "omemo.h"
#include "pgp.h" #include "pgp.h"
#include "util.h" #include "util.h"
#include "diff/diff.h"
void connection__init() void connection__init()
{ {

@ -6,7 +6,7 @@ endif
RM=rm -f RM=rm -f
FIND=find FIND=find
INCLUDES=-Ilibstrophe \ INCLUDES=-Ilibstrophe -Ideps \
$(shell xml2-config --cflags) \ $(shell xml2-config --cflags) \
$(shell pkg-config --cflags librnp-0) \ $(shell pkg-config --cflags librnp-0) \
$(shell pkg-config --cflags libomemo-c) $(shell pkg-config --cflags libomemo-c)
@ -45,7 +45,7 @@ HDRS=plugin.hh \
channel.h \ channel.h \
command.h \ command.h \
completion.h \ completion.h \
config.h \ config.hh \
connection.h \ connection.h \
input.h \ input.h \
message.h \ message.h \
@ -61,7 +61,7 @@ SRCS=plugin.cpp \
channel.c \ channel.c \
command.c \ command.c \
completion.c \ completion.c \
config.c \ config.cpp \
connection.c \ connection.c \
input.c \ input.c \
message.c \ message.c \

@ -10,8 +10,8 @@
#include <weechat/weechat-plugin.h> #include <weechat/weechat-plugin.h>
#include "plugin.hh" #include "plugin.hh"
#include "config.hh"
extern "C" { extern "C" {
#include "config.h"
#include "account.h" #include "account.h"
#include "connection.h" #include "connection.h"
#include "command.h" #include "command.h"

Binary file not shown.
Loading…
Cancel
Save