mirror of
https://github.com/git/git.git
synced 2024-04-28 10:55:11 +02:00
Merge branch 'ab/c99-designated-initializers'
Use designated initializers we started using in mid 2017 in more parts of the codebase that are relatively quiescent. * ab/c99-designated-initializers: fast-import.c: use designated initializers for "partial" struct assignments refspec.c: use designated initializers for "struct refspec_item" convert.c: use designated initializers for "struct stream_filter*" userdiff.c: use designated initializers for "struct userdiff_driver" archive-*.c: use designated initializers for "struct archiver" object-file: use designated initializers for "struct git_hash_algo" trace2: use designated initializers for "struct tr2_dst" trace2: use designated initializers for "struct tr2_tgt" imap-send.c: use designated initializers for "struct imap_server_conf"
This commit is contained in:
commit
20d34c07ea
|
@ -461,9 +461,9 @@ static int write_tar_filter_archive(const struct archiver *ar,
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct archiver tar_archiver = {
|
static struct archiver tar_archiver = {
|
||||||
"tar",
|
.name = "tar",
|
||||||
write_tar_archive,
|
.write_archive = write_tar_archive,
|
||||||
ARCHIVER_REMOTE
|
.flags = ARCHIVER_REMOTE,
|
||||||
};
|
};
|
||||||
|
|
||||||
void init_tar_archiver(void)
|
void init_tar_archiver(void)
|
||||||
|
|
|
@ -638,9 +638,9 @@ static int write_zip_archive(const struct archiver *ar,
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct archiver zip_archiver = {
|
static struct archiver zip_archiver = {
|
||||||
"zip",
|
.name = "zip",
|
||||||
write_zip_archive,
|
.write_archive = write_zip_archive,
|
||||||
ARCHIVER_WANT_COMPRESSION_LEVELS|ARCHIVER_REMOTE
|
.flags = ARCHIVER_WANT_COMPRESSION_LEVELS|ARCHIVER_REMOTE,
|
||||||
};
|
};
|
||||||
|
|
||||||
void init_zip_archiver(void)
|
void init_zip_archiver(void)
|
||||||
|
|
|
@ -177,8 +177,9 @@ static int global_argc;
|
||||||
static const char **global_argv;
|
static const char **global_argv;
|
||||||
|
|
||||||
/* Memory pools */
|
/* Memory pools */
|
||||||
static struct mem_pool fi_mem_pool = {NULL, 2*1024*1024 -
|
static struct mem_pool fi_mem_pool = {
|
||||||
sizeof(struct mp_block), 0 };
|
.block_alloc = 2*1024*1024 - sizeof(struct mp_block),
|
||||||
|
};
|
||||||
|
|
||||||
/* Atom management */
|
/* Atom management */
|
||||||
static unsigned int atom_table_sz = 4451;
|
static unsigned int atom_table_sz = 4451;
|
||||||
|
@ -206,7 +207,9 @@ static int import_marks_file_done;
|
||||||
static int relative_marks_paths;
|
static int relative_marks_paths;
|
||||||
|
|
||||||
/* Our last blob */
|
/* Our last blob */
|
||||||
static struct last_object last_blob = { STRBUF_INIT, 0, 0, 0 };
|
static struct last_object last_blob = {
|
||||||
|
.data = STRBUF_INIT,
|
||||||
|
};
|
||||||
|
|
||||||
/* Tree management */
|
/* Tree management */
|
||||||
static unsigned int tree_entry_alloc = 1000;
|
static unsigned int tree_entry_alloc = 1000;
|
||||||
|
@ -232,7 +235,10 @@ static struct tag *last_tag;
|
||||||
static whenspec_type whenspec = WHENSPEC_RAW;
|
static whenspec_type whenspec = WHENSPEC_RAW;
|
||||||
static struct strbuf command_buf = STRBUF_INIT;
|
static struct strbuf command_buf = STRBUF_INIT;
|
||||||
static int unread_command_buf;
|
static int unread_command_buf;
|
||||||
static struct recent_command cmd_hist = {&cmd_hist, &cmd_hist, NULL};
|
static struct recent_command cmd_hist = {
|
||||||
|
.prev = &cmd_hist,
|
||||||
|
.next = &cmd_hist,
|
||||||
|
};
|
||||||
static struct recent_command *cmd_tail = &cmd_hist;
|
static struct recent_command *cmd_tail = &cmd_hist;
|
||||||
static struct recent_command *rc_free;
|
static struct recent_command *rc_free;
|
||||||
static unsigned int cmd_save = 100;
|
static unsigned int cmd_save = 100;
|
||||||
|
|
18
convert.c
18
convert.c
|
@ -1574,12 +1574,12 @@ static void null_free_fn(struct stream_filter *filter)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct stream_filter_vtbl null_vtbl = {
|
static struct stream_filter_vtbl null_vtbl = {
|
||||||
null_filter_fn,
|
.filter = null_filter_fn,
|
||||||
null_free_fn,
|
.free = null_free_fn,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct stream_filter null_filter_singleton = {
|
static struct stream_filter null_filter_singleton = {
|
||||||
&null_vtbl,
|
.vtbl = &null_vtbl,
|
||||||
};
|
};
|
||||||
|
|
||||||
int is_null_stream_filter(struct stream_filter *filter)
|
int is_null_stream_filter(struct stream_filter *filter)
|
||||||
|
@ -1683,8 +1683,8 @@ static void lf_to_crlf_free_fn(struct stream_filter *filter)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct stream_filter_vtbl lf_to_crlf_vtbl = {
|
static struct stream_filter_vtbl lf_to_crlf_vtbl = {
|
||||||
lf_to_crlf_filter_fn,
|
.filter = lf_to_crlf_filter_fn,
|
||||||
lf_to_crlf_free_fn,
|
.free = lf_to_crlf_free_fn,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct stream_filter *lf_to_crlf_filter(void)
|
static struct stream_filter *lf_to_crlf_filter(void)
|
||||||
|
@ -1779,8 +1779,8 @@ static void cascade_free_fn(struct stream_filter *filter)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct stream_filter_vtbl cascade_vtbl = {
|
static struct stream_filter_vtbl cascade_vtbl = {
|
||||||
cascade_filter_fn,
|
.filter = cascade_filter_fn,
|
||||||
cascade_free_fn,
|
.free = cascade_free_fn,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct stream_filter *cascade_filter(struct stream_filter *one,
|
static struct stream_filter *cascade_filter(struct stream_filter *one,
|
||||||
|
@ -1931,8 +1931,8 @@ static void ident_free_fn(struct stream_filter *filter)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct stream_filter_vtbl ident_vtbl = {
|
static struct stream_filter_vtbl ident_vtbl = {
|
||||||
ident_filter_fn,
|
.filter = ident_filter_fn,
|
||||||
ident_free_fn,
|
.free = ident_free_fn,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct stream_filter *ident_filter(const struct object_id *oid)
|
static struct stream_filter *ident_filter(const struct object_id *oid)
|
||||||
|
|
12
imap-send.c
12
imap-send.c
|
@ -98,17 +98,7 @@ struct imap_server_conf {
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct imap_server_conf server = {
|
static struct imap_server_conf server = {
|
||||||
NULL, /* name */
|
.ssl_verify = 1,
|
||||||
NULL, /* tunnel */
|
|
||||||
NULL, /* host */
|
|
||||||
0, /* port */
|
|
||||||
NULL, /* folder */
|
|
||||||
NULL, /* user */
|
|
||||||
NULL, /* pass */
|
|
||||||
0, /* use_ssl */
|
|
||||||
1, /* ssl_verify */
|
|
||||||
0, /* use_html */
|
|
||||||
NULL, /* auth_method */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct imap_socket {
|
struct imap_socket {
|
||||||
|
|
|
@ -167,49 +167,49 @@ static void git_hash_unknown_final_oid(struct object_id *oid, git_hash_ctx *ctx)
|
||||||
|
|
||||||
const struct git_hash_algo hash_algos[GIT_HASH_NALGOS] = {
|
const struct git_hash_algo hash_algos[GIT_HASH_NALGOS] = {
|
||||||
{
|
{
|
||||||
NULL,
|
.name = NULL,
|
||||||
0x00000000,
|
.format_id = 0x00000000,
|
||||||
0,
|
.rawsz = 0,
|
||||||
0,
|
.hexsz = 0,
|
||||||
0,
|
.blksz = 0,
|
||||||
git_hash_unknown_init,
|
.init_fn = git_hash_unknown_init,
|
||||||
git_hash_unknown_clone,
|
.clone_fn = git_hash_unknown_clone,
|
||||||
git_hash_unknown_update,
|
.update_fn = git_hash_unknown_update,
|
||||||
git_hash_unknown_final,
|
.final_fn = git_hash_unknown_final,
|
||||||
git_hash_unknown_final_oid,
|
.final_oid_fn = git_hash_unknown_final_oid,
|
||||||
NULL,
|
.empty_tree = NULL,
|
||||||
NULL,
|
.empty_blob = NULL,
|
||||||
NULL,
|
.null_oid = NULL,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sha1",
|
.name = "sha1",
|
||||||
GIT_SHA1_FORMAT_ID,
|
.format_id = GIT_SHA1_FORMAT_ID,
|
||||||
GIT_SHA1_RAWSZ,
|
.rawsz = GIT_SHA1_RAWSZ,
|
||||||
GIT_SHA1_HEXSZ,
|
.hexsz = GIT_SHA1_HEXSZ,
|
||||||
GIT_SHA1_BLKSZ,
|
.blksz = GIT_SHA1_BLKSZ,
|
||||||
git_hash_sha1_init,
|
.init_fn = git_hash_sha1_init,
|
||||||
git_hash_sha1_clone,
|
.clone_fn = git_hash_sha1_clone,
|
||||||
git_hash_sha1_update,
|
.update_fn = git_hash_sha1_update,
|
||||||
git_hash_sha1_final,
|
.final_fn = git_hash_sha1_final,
|
||||||
git_hash_sha1_final_oid,
|
.final_oid_fn = git_hash_sha1_final_oid,
|
||||||
&empty_tree_oid,
|
.empty_tree = &empty_tree_oid,
|
||||||
&empty_blob_oid,
|
.empty_blob = &empty_blob_oid,
|
||||||
&null_oid_sha1,
|
.null_oid = &null_oid_sha1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sha256",
|
.name = "sha256",
|
||||||
GIT_SHA256_FORMAT_ID,
|
.format_id = GIT_SHA256_FORMAT_ID,
|
||||||
GIT_SHA256_RAWSZ,
|
.rawsz = GIT_SHA256_RAWSZ,
|
||||||
GIT_SHA256_HEXSZ,
|
.hexsz = GIT_SHA256_HEXSZ,
|
||||||
GIT_SHA256_BLKSZ,
|
.blksz = GIT_SHA256_BLKSZ,
|
||||||
git_hash_sha256_init,
|
.init_fn = git_hash_sha256_init,
|
||||||
git_hash_sha256_clone,
|
.clone_fn = git_hash_sha256_clone,
|
||||||
git_hash_sha256_update,
|
.update_fn = git_hash_sha256_update,
|
||||||
git_hash_sha256_final,
|
.final_fn = git_hash_sha256_final,
|
||||||
git_hash_sha256_final_oid,
|
.final_oid_fn = git_hash_sha256_final_oid,
|
||||||
&empty_tree_oid_sha256,
|
.empty_tree = &empty_tree_oid_sha256,
|
||||||
&empty_blob_oid_sha256,
|
.empty_blob = &empty_blob_oid_sha256,
|
||||||
&null_oid_sha256,
|
.null_oid = &null_oid_sha256,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
14
refspec.c
14
refspec.c
|
@ -4,13 +4,13 @@
|
||||||
#include "refspec.h"
|
#include "refspec.h"
|
||||||
|
|
||||||
static struct refspec_item s_tag_refspec = {
|
static struct refspec_item s_tag_refspec = {
|
||||||
0,
|
.force = 0,
|
||||||
1,
|
.pattern = 1,
|
||||||
0,
|
.matching = 0,
|
||||||
0,
|
.exact_sha1 = 0,
|
||||||
0,
|
.negative = 0,
|
||||||
"refs/tags/*",
|
.src = "refs/tags/*",
|
||||||
"refs/tags/*"
|
.dst = "refs/tags/*",
|
||||||
};
|
};
|
||||||
|
|
||||||
/* See TAG_REFSPEC for the string version */
|
/* See TAG_REFSPEC for the string version */
|
||||||
|
|
|
@ -10,7 +10,9 @@
|
||||||
#include "trace2/tr2_tgt.h"
|
#include "trace2/tr2_tgt.h"
|
||||||
#include "trace2/tr2_tls.h"
|
#include "trace2/tr2_tls.h"
|
||||||
|
|
||||||
static struct tr2_dst tr2dst_event = { TR2_SYSENV_EVENT, 0, 0, 0, 0 };
|
static struct tr2_dst tr2dst_event = {
|
||||||
|
.sysenv_var = TR2_SYSENV_EVENT,
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The version number of the JSON data generated by the EVENT target in this
|
* The version number of the JSON data generated by the EVENT target in this
|
||||||
|
@ -613,34 +615,34 @@ static void fn_data_json_fl(const char *file, int line,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct tr2_tgt tr2_tgt_event = {
|
struct tr2_tgt tr2_tgt_event = {
|
||||||
&tr2dst_event,
|
.pdst = &tr2dst_event,
|
||||||
|
|
||||||
fn_init,
|
.pfn_init = fn_init,
|
||||||
fn_term,
|
.pfn_term = fn_term,
|
||||||
|
|
||||||
fn_version_fl,
|
.pfn_version_fl = fn_version_fl,
|
||||||
fn_start_fl,
|
.pfn_start_fl = fn_start_fl,
|
||||||
fn_exit_fl,
|
.pfn_exit_fl = fn_exit_fl,
|
||||||
fn_signal,
|
.pfn_signal = fn_signal,
|
||||||
fn_atexit,
|
.pfn_atexit = fn_atexit,
|
||||||
fn_error_va_fl,
|
.pfn_error_va_fl = fn_error_va_fl,
|
||||||
fn_command_path_fl,
|
.pfn_command_path_fl = fn_command_path_fl,
|
||||||
fn_command_ancestry_fl,
|
.pfn_command_ancestry_fl = fn_command_ancestry_fl,
|
||||||
fn_command_name_fl,
|
.pfn_command_name_fl = fn_command_name_fl,
|
||||||
fn_command_mode_fl,
|
.pfn_command_mode_fl = fn_command_mode_fl,
|
||||||
fn_alias_fl,
|
.pfn_alias_fl = fn_alias_fl,
|
||||||
fn_child_start_fl,
|
.pfn_child_start_fl = fn_child_start_fl,
|
||||||
fn_child_exit_fl,
|
.pfn_child_exit_fl = fn_child_exit_fl,
|
||||||
fn_child_ready_fl,
|
.pfn_child_ready_fl = fn_child_ready_fl,
|
||||||
fn_thread_start_fl,
|
.pfn_thread_start_fl = fn_thread_start_fl,
|
||||||
fn_thread_exit_fl,
|
.pfn_thread_exit_fl = fn_thread_exit_fl,
|
||||||
fn_exec_fl,
|
.pfn_exec_fl = fn_exec_fl,
|
||||||
fn_exec_result_fl,
|
.pfn_exec_result_fl = fn_exec_result_fl,
|
||||||
fn_param_fl,
|
.pfn_param_fl = fn_param_fl,
|
||||||
fn_repo_fl,
|
.pfn_repo_fl = fn_repo_fl,
|
||||||
fn_region_enter_printf_va_fl,
|
.pfn_region_enter_printf_va_fl = fn_region_enter_printf_va_fl,
|
||||||
fn_region_leave_printf_va_fl,
|
.pfn_region_leave_printf_va_fl = fn_region_leave_printf_va_fl,
|
||||||
fn_data_fl,
|
.pfn_data_fl = fn_data_fl,
|
||||||
fn_data_json_fl,
|
.pfn_data_json_fl = fn_data_json_fl,
|
||||||
NULL, /* printf */
|
.pfn_printf_va_fl = NULL,
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,7 +9,9 @@
|
||||||
#include "trace2/tr2_tgt.h"
|
#include "trace2/tr2_tgt.h"
|
||||||
#include "trace2/tr2_tls.h"
|
#include "trace2/tr2_tls.h"
|
||||||
|
|
||||||
static struct tr2_dst tr2dst_normal = { TR2_SYSENV_NORMAL, 0, 0, 0, 0 };
|
static struct tr2_dst tr2dst_normal = {
|
||||||
|
.sysenv_var = TR2_SYSENV_NORMAL,
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Use the TR2_SYSENV_NORMAL_BRIEF setting to omit the "<time> <file>:<line>"
|
* Use the TR2_SYSENV_NORMAL_BRIEF setting to omit the "<time> <file>:<line>"
|
||||||
|
@ -325,34 +327,34 @@ static void fn_printf_va_fl(const char *file, int line,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct tr2_tgt tr2_tgt_normal = {
|
struct tr2_tgt tr2_tgt_normal = {
|
||||||
&tr2dst_normal,
|
.pdst = &tr2dst_normal,
|
||||||
|
|
||||||
fn_init,
|
.pfn_init = fn_init,
|
||||||
fn_term,
|
.pfn_term = fn_term,
|
||||||
|
|
||||||
fn_version_fl,
|
.pfn_version_fl = fn_version_fl,
|
||||||
fn_start_fl,
|
.pfn_start_fl = fn_start_fl,
|
||||||
fn_exit_fl,
|
.pfn_exit_fl = fn_exit_fl,
|
||||||
fn_signal,
|
.pfn_signal = fn_signal,
|
||||||
fn_atexit,
|
.pfn_atexit = fn_atexit,
|
||||||
fn_error_va_fl,
|
.pfn_error_va_fl = fn_error_va_fl,
|
||||||
fn_command_path_fl,
|
.pfn_command_path_fl = fn_command_path_fl,
|
||||||
fn_command_ancestry_fl,
|
.pfn_command_ancestry_fl = fn_command_ancestry_fl,
|
||||||
fn_command_name_fl,
|
.pfn_command_name_fl = fn_command_name_fl,
|
||||||
fn_command_mode_fl,
|
.pfn_command_mode_fl = fn_command_mode_fl,
|
||||||
fn_alias_fl,
|
.pfn_alias_fl = fn_alias_fl,
|
||||||
fn_child_start_fl,
|
.pfn_child_start_fl = fn_child_start_fl,
|
||||||
fn_child_exit_fl,
|
.pfn_child_exit_fl = fn_child_exit_fl,
|
||||||
fn_child_ready_fl,
|
.pfn_child_ready_fl = fn_child_ready_fl,
|
||||||
NULL, /* thread_start */
|
.pfn_thread_start_fl = NULL,
|
||||||
NULL, /* thread_exit */
|
.pfn_thread_exit_fl = NULL,
|
||||||
fn_exec_fl,
|
.pfn_exec_fl = fn_exec_fl,
|
||||||
fn_exec_result_fl,
|
.pfn_exec_result_fl = fn_exec_result_fl,
|
||||||
fn_param_fl,
|
.pfn_param_fl = fn_param_fl,
|
||||||
fn_repo_fl,
|
.pfn_repo_fl = fn_repo_fl,
|
||||||
NULL, /* region_enter */
|
.pfn_region_enter_printf_va_fl = NULL,
|
||||||
NULL, /* region_leave */
|
.pfn_region_leave_printf_va_fl = NULL,
|
||||||
NULL, /* data */
|
.pfn_data_fl = NULL,
|
||||||
NULL, /* data_json */
|
.pfn_data_json_fl = NULL,
|
||||||
fn_printf_va_fl,
|
.pfn_printf_va_fl = fn_printf_va_fl,
|
||||||
};
|
};
|
||||||
|
|
|
@ -11,7 +11,9 @@
|
||||||
#include "trace2/tr2_tgt.h"
|
#include "trace2/tr2_tgt.h"
|
||||||
#include "trace2/tr2_tls.h"
|
#include "trace2/tr2_tls.h"
|
||||||
|
|
||||||
static struct tr2_dst tr2dst_perf = { TR2_SYSENV_PERF, 0, 0, 0, 0 };
|
static struct tr2_dst tr2dst_perf = {
|
||||||
|
.sysenv_var = TR2_SYSENV_PERF,
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Use TR2_SYSENV_PERF_BRIEF to omit the "<time> <file>:<line>"
|
* Use TR2_SYSENV_PERF_BRIEF to omit the "<time> <file>:<line>"
|
||||||
|
@ -549,34 +551,34 @@ static void fn_printf_va_fl(const char *file, int line,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct tr2_tgt tr2_tgt_perf = {
|
struct tr2_tgt tr2_tgt_perf = {
|
||||||
&tr2dst_perf,
|
.pdst = &tr2dst_perf,
|
||||||
|
|
||||||
fn_init,
|
.pfn_init = fn_init,
|
||||||
fn_term,
|
.pfn_term = fn_term,
|
||||||
|
|
||||||
fn_version_fl,
|
.pfn_version_fl = fn_version_fl,
|
||||||
fn_start_fl,
|
.pfn_start_fl = fn_start_fl,
|
||||||
fn_exit_fl,
|
.pfn_exit_fl = fn_exit_fl,
|
||||||
fn_signal,
|
.pfn_signal = fn_signal,
|
||||||
fn_atexit,
|
.pfn_atexit = fn_atexit,
|
||||||
fn_error_va_fl,
|
.pfn_error_va_fl = fn_error_va_fl,
|
||||||
fn_command_path_fl,
|
.pfn_command_path_fl = fn_command_path_fl,
|
||||||
fn_command_ancestry_fl,
|
.pfn_command_ancestry_fl = fn_command_ancestry_fl,
|
||||||
fn_command_name_fl,
|
.pfn_command_name_fl = fn_command_name_fl,
|
||||||
fn_command_mode_fl,
|
.pfn_command_mode_fl = fn_command_mode_fl,
|
||||||
fn_alias_fl,
|
.pfn_alias_fl = fn_alias_fl,
|
||||||
fn_child_start_fl,
|
.pfn_child_start_fl = fn_child_start_fl,
|
||||||
fn_child_exit_fl,
|
.pfn_child_exit_fl = fn_child_exit_fl,
|
||||||
fn_child_ready_fl,
|
.pfn_child_ready_fl = fn_child_ready_fl,
|
||||||
fn_thread_start_fl,
|
.pfn_thread_start_fl = fn_thread_start_fl,
|
||||||
fn_thread_exit_fl,
|
.pfn_thread_exit_fl = fn_thread_exit_fl,
|
||||||
fn_exec_fl,
|
.pfn_exec_fl = fn_exec_fl,
|
||||||
fn_exec_result_fl,
|
.pfn_exec_result_fl = fn_exec_result_fl,
|
||||||
fn_param_fl,
|
.pfn_param_fl = fn_param_fl,
|
||||||
fn_repo_fl,
|
.pfn_repo_fl = fn_repo_fl,
|
||||||
fn_region_enter_printf_va_fl,
|
.pfn_region_enter_printf_va_fl = fn_region_enter_printf_va_fl,
|
||||||
fn_region_leave_printf_va_fl,
|
.pfn_region_leave_printf_va_fl = fn_region_leave_printf_va_fl,
|
||||||
fn_data_fl,
|
.pfn_data_fl = fn_data_fl,
|
||||||
fn_data_json_fl,
|
.pfn_data_json_fl = fn_data_json_fl,
|
||||||
fn_printf_va_fl,
|
.pfn_printf_va_fl = fn_printf_va_fl,
|
||||||
};
|
};
|
||||||
|
|
36
userdiff.c
36
userdiff.c
|
@ -7,12 +7,24 @@ static struct userdiff_driver *drivers;
|
||||||
static int ndrivers;
|
static int ndrivers;
|
||||||
static int drivers_alloc;
|
static int drivers_alloc;
|
||||||
|
|
||||||
#define PATTERNS(name, pattern, word_regex) \
|
#define PATTERNS(lang, rx, wrx) { \
|
||||||
{ name, NULL, -1, { pattern, REG_EXTENDED }, \
|
.name = lang, \
|
||||||
word_regex "|[^[:space:]]|[\xc0-\xff][\x80-\xbf]+" }
|
.binary = -1, \
|
||||||
#define IPATTERN(name, pattern, word_regex) \
|
.funcname = { \
|
||||||
{ name, NULL, -1, { pattern, REG_EXTENDED | REG_ICASE }, \
|
.pattern = rx, \
|
||||||
word_regex "|[^[:space:]]|[\xc0-\xff][\x80-\xbf]+" }
|
.cflags = REG_EXTENDED, \
|
||||||
|
}, \
|
||||||
|
.word_regex = wrx "|[^[:space:]]|[\xc0-\xff][\x80-\xbf]+", \
|
||||||
|
}
|
||||||
|
#define IPATTERN(lang, rx, wrx) { \
|
||||||
|
.name = lang, \
|
||||||
|
.binary = -1, \
|
||||||
|
.funcname = { \
|
||||||
|
.pattern = rx, \
|
||||||
|
.cflags = REG_EXTENDED | REG_ICASE, \
|
||||||
|
}, \
|
||||||
|
.word_regex = wrx "|[^[:space:]]|[\xc0-\xff][\x80-\xbf]+", \
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Built-in drivers for various languages, sorted by their names
|
* Built-in drivers for various languages, sorted by their names
|
||||||
|
@ -275,17 +287,13 @@ PATTERNS("tex", "^(\\\\((sub)*section|chapter|part)\\*{0,1}\\{.*)$",
|
||||||
#undef IPATTERN
|
#undef IPATTERN
|
||||||
|
|
||||||
static struct userdiff_driver driver_true = {
|
static struct userdiff_driver driver_true = {
|
||||||
"diff=true",
|
.name = "diff=true",
|
||||||
NULL,
|
.binary = 0,
|
||||||
0,
|
|
||||||
{ NULL, 0 }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct userdiff_driver driver_false = {
|
static struct userdiff_driver driver_false = {
|
||||||
"!diff",
|
.name = "!diff",
|
||||||
NULL,
|
.binary = 1,
|
||||||
1,
|
|
||||||
{ NULL, 0 }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct find_by_namelen_data {
|
struct find_by_namelen_data {
|
||||||
|
|
Loading…
Reference in New Issue