config.c -> cpp

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

@ -45,11 +45,11 @@ ln -sf $(guix build --source lmdb)/libraries/liblmdb/mdb.c mdb.c
use guix \
${ENVIRONMENTS[@]} --ad-hoc ${PACKAGES[@]} \
--with-debug-info=profanity\
--with-debug-info=profanity \
--with-debug-info=weechat \
--with-debug-info=libstrophe \
--with-debug-info=libsignal-protocol-c \
--with-debug-info=libomemo-c\
--with-debug-info=libomemo-c \
--with-debug-info=lmdb \
--with-debug-info=rnp \
clang clang:extra ccls gdb

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

@ -10,7 +10,7 @@
#include <weechat/weechat-plugin.h>
#include "plugin.hh"
#include "config.h"
#include "config.hh"
#include "account.h"
#include "channel.h"
#include "user.h"
@ -59,7 +59,7 @@ int completion__channel_nicks_cb(const void *pointer, void *data,
(void) pointer;
(void) data;
(void) completion_item;
ptr_account = NULL;
ptr_channel = NULL;
buffer__get_account_and_channel(buffer, &ptr_account, &ptr_channel);
@ -128,12 +128,12 @@ void completion__init()
struct t_config_option *option;
const char *default_template;
weechat_hook_completion("nick",
N_("nicks of current Slack channel"),
&completion__channel_nicks_cb,
NULL, NULL);
weechat_hook_completion("account",
N_("xmpp accounts"),
&completion__accounts_cb,

@ -10,7 +10,7 @@
#include "plugin.hh"
#include "account.h"
#include "config.h"
#include "config.hh"
struct t_config_file *config_file;
@ -302,7 +302,7 @@ int config__account_read_cb (const void *pointer, void *data,
if (option_name)
{
pos_option = strrchr(option_name, '.');
pos_option = const_cast<char*>(strrchr(option_name, '.'));
if (pos_option)
{
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 "plugin.hh"
#include "diff/diff.h"
#include "xmpp/stanza.hh"
#include "config.h"
#include "config.hh"
#include "account.h"
#include "user.h"
#include "channel.h"
@ -22,6 +21,7 @@
#include "omemo.h"
#include "pgp.h"
#include "util.h"
#include "diff/diff.h"
void connection__init()
{

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

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

Binary file not shown.
Loading…
Cancel
Save