Ticket #3693: 3693-mc_search__cond_struct_new_regex_ci_str-add-documentation.patch

File 3693-mc_search__cond_struct_new_regex_ci_str-add-documentation.patch, 1.2 KB (added by mooffie, 5 years ago)

(This documentation is needed to better understand the patch I'll have for #3589.)

  • lib/search/regex.c

    From c124965799fa9052e74756ab78d03714c6e54fff Mon Sep 17 00:00:00 2001
    From: Mooffie <mooffie@gmail.com>
    Date: Thu, 1 Dec 2016 16:14:27 +0200
    Subject: [PATCH] (mc_search__cond_struct_new_regex_ci_str): add documentation.
    
    ---
     lib/search/regex.c | 13 +++++++++++++
     1 file changed, 13 insertions(+)
    
    diff --git a/lib/search/regex.c b/lib/search/regex.c
    index e8d896c..863fb57 100644
    a b mc_search__cond_struct_new_regex_accum_append (const char *charset, GString * st 
    195195 
    196196/* --------------------------------------------------------------------------------------------- */ 
    197197 
     198/** 
     199 * Creates a case-insensitive version of a regex pattern. 
     200 * 
     201 * For example (assuming ASCII charset): given "\\bHello!\\xAB", returns 
     202 * "\\b[Hh][Ee][Ll][Ll][Oo]!\\xAB" (this example is for easier reading; in 
     203 * reality hex codes are used instead of letters). 
     204 * 
     205 * This function knows not to ruin special regex symbols. 
     206 * 
     207 * This function is used when working with non-UTF-8 charsets: GLib's 
     208 * regex engine doesn't understand such charsets and therefore can't do 
     209 * this job itself. 
     210 */ 
    198211static GString * 
    199212mc_search__cond_struct_new_regex_ci_str (const char *charset, const GString * astr) 
    200213{