Revision: 1343 http://svn.sourceforge.net/geany/?rev=1343&view=rev Author: ntrel Date: 2007-02-27 06:53:37 -0800 (Tue, 27 Feb 2007)
Log Message: ----------- Use utils_strv_new() for all filetype patterns.
Modified Paths: -------------- trunk/src/filetypes.c
Modified: trunk/src/filetypes.c =================================================================== --- trunk/src/filetypes.c 2007-02-26 15:21:15 UTC (rev 1342) +++ trunk/src/filetypes.c 2007-02-27 14:53:37 UTC (rev 1343) @@ -135,10 +135,7 @@ filetypes[GEANY_FILETYPES_C]->has_tags = TRUE; filetypes[GEANY_FILETYPES_C]->title = g_strdup(_("C source file")); filetypes[GEANY_FILETYPES_C]->extension = g_strdup("c"); - filetypes[GEANY_FILETYPES_C]->pattern = g_new0(gchar*, 3); - filetypes[GEANY_FILETYPES_C]->pattern[0] = g_strdup("*.c"); - filetypes[GEANY_FILETYPES_C]->pattern[1] = g_strdup("*.h"); - filetypes[GEANY_FILETYPES_C]->pattern[2] = NULL; + filetypes[GEANY_FILETYPES_C]->pattern = utils_strv_new("*.c", "*.h", NULL); filetypes[GEANY_FILETYPES_C]->comment_open = g_strdup("/*"); filetypes[GEANY_FILETYPES_C]->comment_close = g_strdup("*/"); filetypes[GEANY_FILETYPES_C]->style_func_ptr = styleset_c; @@ -155,18 +152,8 @@ filetypes[GEANY_FILETYPES_CPP]->has_tags = TRUE; filetypes[GEANY_FILETYPES_CPP]->title = g_strdup(_("C++ source file")); filetypes[GEANY_FILETYPES_CPP]->extension = g_strdup("cpp"); - filetypes[GEANY_FILETYPES_CPP]->pattern = g_new0(gchar*, 11); - filetypes[GEANY_FILETYPES_CPP]->pattern[0] = g_strdup("*.cpp"); - filetypes[GEANY_FILETYPES_CPP]->pattern[1] = g_strdup("*.cxx"); - filetypes[GEANY_FILETYPES_CPP]->pattern[2] = g_strdup("*.c++"); - filetypes[GEANY_FILETYPES_CPP]->pattern[3] = g_strdup("*.cc"); - filetypes[GEANY_FILETYPES_CPP]->pattern[4] = g_strdup("*.h"); - filetypes[GEANY_FILETYPES_CPP]->pattern[5] = g_strdup("*.hpp"); - filetypes[GEANY_FILETYPES_CPP]->pattern[6] = g_strdup("*.hxx"); - filetypes[GEANY_FILETYPES_CPP]->pattern[7] = g_strdup("*.h++"); - filetypes[GEANY_FILETYPES_CPP]->pattern[8] = g_strdup("*.hh"); - filetypes[GEANY_FILETYPES_CPP]->pattern[9] = g_strdup("*.C"); - filetypes[GEANY_FILETYPES_CPP]->pattern[10] = NULL; + filetypes[GEANY_FILETYPES_CPP]->pattern = utils_strv_new("*.cpp", "*.cxx", "*.c++", "*.cc", + "*.h", "*.hpp", "*.hxx", "*.h++", "*.hh", "*.C", NULL); filetypes[GEANY_FILETYPES_CPP]->style_func_ptr = styleset_cpp; filetypes[GEANY_FILETYPES_CPP]->comment_open = g_strdup("//"); filetypes[GEANY_FILETYPES_CPP]->comment_close = NULL; @@ -183,10 +170,7 @@ filetypes[GEANY_FILETYPES_D]->has_tags = TRUE; filetypes[GEANY_FILETYPES_D]->title = g_strdup(_("D source file")); filetypes[GEANY_FILETYPES_D]->extension = g_strdup("d"); - filetypes[GEANY_FILETYPES_D]->pattern = g_new0(gchar*, 3); - filetypes[GEANY_FILETYPES_D]->pattern[0] = g_strdup("*.d"); - filetypes[GEANY_FILETYPES_D]->pattern[1] = g_strdup("*.di"); - filetypes[GEANY_FILETYPES_D]->pattern[2] = NULL; + filetypes[GEANY_FILETYPES_D]->pattern = utils_strv_new("*.d", "*.di", NULL); filetypes[GEANY_FILETYPES_D]->comment_open = g_strdup("//"); filetypes[GEANY_FILETYPES_D]->comment_close = NULL; filetypes[GEANY_FILETYPES_D]->style_func_ptr = styleset_d; @@ -203,10 +187,7 @@ filetypes[GEANY_FILETYPES_JAVA]->has_tags = TRUE; filetypes[GEANY_FILETYPES_JAVA]->title = g_strdup(_("Java source file")); filetypes[GEANY_FILETYPES_JAVA]->extension = g_strdup("java"); - filetypes[GEANY_FILETYPES_JAVA]->pattern = g_new0(gchar*, 3); - filetypes[GEANY_FILETYPES_JAVA]->pattern[0] = g_strdup("*.java"); - filetypes[GEANY_FILETYPES_JAVA]->pattern[1] = g_strdup("*.jsp"); - filetypes[GEANY_FILETYPES_JAVA]->pattern[2] = NULL; + filetypes[GEANY_FILETYPES_JAVA]->pattern = utils_strv_new("*.java", "*.jsp", NULL); filetypes[GEANY_FILETYPES_JAVA]->comment_open = g_strdup("/*"); filetypes[GEANY_FILETYPES_JAVA]->comment_close = g_strdup("*/"); filetypes[GEANY_FILETYPES_JAVA]->style_func_ptr = styleset_java; @@ -223,13 +204,8 @@ filetypes[GEANY_FILETYPES_PASCAL]->has_tags = TRUE; filetypes[GEANY_FILETYPES_PASCAL]->title = g_strdup(_("Pascal source file")); filetypes[GEANY_FILETYPES_PASCAL]->extension = g_strdup("pas"); - filetypes[GEANY_FILETYPES_PASCAL]->pattern = g_new0(gchar*, 6); - filetypes[GEANY_FILETYPES_PASCAL]->pattern[0] = g_strdup("*.pas"); - filetypes[GEANY_FILETYPES_PASCAL]->pattern[1] = g_strdup("*.pp"); - filetypes[GEANY_FILETYPES_PASCAL]->pattern[2] = g_strdup("*.inc"); - filetypes[GEANY_FILETYPES_PASCAL]->pattern[3] = g_strdup("*.dpr"); - filetypes[GEANY_FILETYPES_PASCAL]->pattern[4] = g_strdup("*.dpk"); - filetypes[GEANY_FILETYPES_PASCAL]->pattern[5] = NULL; + filetypes[GEANY_FILETYPES_PASCAL]->pattern = utils_strv_new("*.pas", "*.pp", "*.inc", "*.dpr", + "*.dpk", NULL); filetypes[GEANY_FILETYPES_PASCAL]->style_func_ptr = styleset_pascal; filetypes[GEANY_FILETYPES_PASCAL]->comment_open = g_strdup("{"); filetypes[GEANY_FILETYPES_PASCAL]->comment_close = g_strdup("}"); @@ -246,9 +222,7 @@ filetypes[GEANY_FILETYPES_ASM]->has_tags = TRUE; filetypes[GEANY_FILETYPES_ASM]->title = g_strdup(_("Assembler source file")); filetypes[GEANY_FILETYPES_ASM]->extension = g_strdup("asm"); - filetypes[GEANY_FILETYPES_ASM]->pattern = g_new0(gchar*, 2); - filetypes[GEANY_FILETYPES_ASM]->pattern[0] = g_strdup("*.asm"); - filetypes[GEANY_FILETYPES_ASM]->pattern[1] = NULL; + filetypes[GEANY_FILETYPES_ASM]->pattern = utils_strv_new("*.asm", NULL); filetypes[GEANY_FILETYPES_ASM]->style_func_ptr = styleset_asm; filetypes[GEANY_FILETYPES_ASM]->comment_open = g_strdup(";"); filetypes[GEANY_FILETYPES_ASM]->comment_close = NULL; @@ -265,14 +239,8 @@ filetypes[GEANY_FILETYPES_FORTRAN]->has_tags = TRUE; filetypes[GEANY_FILETYPES_FORTRAN]->title = g_strdup(_("Fortran source file (F77)")); filetypes[GEANY_FILETYPES_FORTRAN]->extension = g_strdup("f"); - filetypes[GEANY_FILETYPES_FORTRAN]->pattern = g_new0(gchar*, 7); - filetypes[GEANY_FILETYPES_FORTRAN]->pattern[0] = g_strdup("*.f"); - filetypes[GEANY_FILETYPES_FORTRAN]->pattern[1] = g_strdup("*.for"); - filetypes[GEANY_FILETYPES_FORTRAN]->pattern[2] = g_strdup("*.ftn"); - filetypes[GEANY_FILETYPES_FORTRAN]->pattern[3] = g_strdup("*.f77"); - filetypes[GEANY_FILETYPES_FORTRAN]->pattern[4] = g_strdup("*.f90"); - filetypes[GEANY_FILETYPES_FORTRAN]->pattern[5] = g_strdup("*.f95"); - filetypes[GEANY_FILETYPES_FORTRAN]->pattern[6] = NULL; + filetypes[GEANY_FILETYPES_FORTRAN]->pattern = utils_strv_new("*.f", "*.for", "*.ftn", "*.f77", + "*.f90", "*.f95", NULL); filetypes[GEANY_FILETYPES_FORTRAN]->style_func_ptr = styleset_fortran; filetypes[GEANY_FILETYPES_FORTRAN]->comment_open = g_strdup("c"); filetypes[GEANY_FILETYPES_FORTRAN]->comment_close = NULL; @@ -289,10 +257,7 @@ filetypes[GEANY_FILETYPES_CAML]->has_tags = FALSE; filetypes[GEANY_FILETYPES_CAML]->title = g_strdup(_("(O)Caml source file")); filetypes[GEANY_FILETYPES_CAML]->extension = g_strdup("ml"); - filetypes[GEANY_FILETYPES_CAML]->pattern = g_new0(gchar*, 3); - filetypes[GEANY_FILETYPES_CAML]->pattern[0] = g_strdup("*.ml"); - filetypes[GEANY_FILETYPES_CAML]->pattern[1] = g_strdup("*.mli"); - filetypes[GEANY_FILETYPES_CAML]->pattern[2] = NULL; + filetypes[GEANY_FILETYPES_CAML]->pattern = utils_strv_new("*.ml", "*.mli", NULL); filetypes[GEANY_FILETYPES_CAML]->style_func_ptr = styleset_caml; filetypes[GEANY_FILETYPES_CAML]->comment_open = g_strdup("(*"); filetypes[GEANY_FILETYPES_CAML]->comment_close = g_strdup("*)"); @@ -309,13 +274,8 @@ filetypes[GEANY_FILETYPES_PERL]->has_tags = TRUE; filetypes[GEANY_FILETYPES_PERL]->title = g_strdup(_("Perl source file")); filetypes[GEANY_FILETYPES_PERL]->extension = g_strdup("perl"); - filetypes[GEANY_FILETYPES_PERL]->pattern = g_new0(gchar*, 6); - filetypes[GEANY_FILETYPES_PERL]->pattern[0] = g_strdup("*.pl"); - filetypes[GEANY_FILETYPES_PERL]->pattern[1] = g_strdup("*.perl"); - filetypes[GEANY_FILETYPES_PERL]->pattern[2] = g_strdup("*.pm"); - filetypes[GEANY_FILETYPES_PERL]->pattern[3] = g_strdup("*.agi"); - filetypes[GEANY_FILETYPES_PERL]->pattern[4] = g_strdup("*.pod"); - filetypes[GEANY_FILETYPES_PERL]->pattern[5] = NULL; + filetypes[GEANY_FILETYPES_PERL]->pattern = utils_strv_new("*.pl", "*.perl", "*.pm", "*.agi", + "*.pod", NULL); filetypes[GEANY_FILETYPES_PERL]->comment_open = g_strdup("#"); filetypes[GEANY_FILETYPES_PERL]->comment_close = NULL; filetypes[GEANY_FILETYPES_PERL]->style_func_ptr = styleset_perl; @@ -332,13 +292,8 @@ filetypes[GEANY_FILETYPES_PHP]->has_tags = TRUE; filetypes[GEANY_FILETYPES_PHP]->title = g_strdup(_("PHP source file")); filetypes[GEANY_FILETYPES_PHP]->extension = g_strdup("php"); - filetypes[GEANY_FILETYPES_PHP]->pattern = g_new0(gchar*, 6); - filetypes[GEANY_FILETYPES_PHP]->pattern[0] = g_strdup("*.php"); - filetypes[GEANY_FILETYPES_PHP]->pattern[1] = g_strdup("*.php3"); - filetypes[GEANY_FILETYPES_PHP]->pattern[2] = g_strdup("*.php4"); - filetypes[GEANY_FILETYPES_PHP]->pattern[3] = g_strdup("*.php5"); - filetypes[GEANY_FILETYPES_PHP]->pattern[4] = g_strdup("*.phtml"); - filetypes[GEANY_FILETYPES_PHP]->pattern[5] = NULL; + filetypes[GEANY_FILETYPES_PHP]->pattern = utils_strv_new("*.php", "*.php3", "*.php4", "*.php5", + "*.phtml", NULL); filetypes[GEANY_FILETYPES_PHP]->style_func_ptr = styleset_php; filetypes[GEANY_FILETYPES_PHP]->comment_open = g_strdup("//"); filetypes[GEANY_FILETYPES_PHP]->comment_close = NULL; @@ -355,9 +310,7 @@ filetypes[GEANY_FILETYPES_JS]->has_tags = TRUE; filetypes[GEANY_FILETYPES_JS]->title = g_strdup(_("Javascript source file")); filetypes[GEANY_FILETYPES_JS]->extension = g_strdup("js"); - filetypes[GEANY_FILETYPES_JS]->pattern = g_new0(gchar*, 2); - filetypes[GEANY_FILETYPES_JS]->pattern[0] = g_strdup("*.js"); - filetypes[GEANY_FILETYPES_JS]->pattern[1] = NULL; + filetypes[GEANY_FILETYPES_JS]->pattern = utils_strv_new("*.js", NULL); filetypes[GEANY_FILETYPES_JS]->style_func_ptr = styleset_js; filetypes[GEANY_FILETYPES_JS]->comment_open = g_strdup("//"); filetypes[GEANY_FILETYPES_JS]->comment_close = NULL; @@ -374,10 +327,7 @@ filetypes[GEANY_FILETYPES_PYTHON]->has_tags = TRUE; filetypes[GEANY_FILETYPES_PYTHON]->title = g_strdup(_("Python source file")); filetypes[GEANY_FILETYPES_PYTHON]->extension = g_strdup("py"); - filetypes[GEANY_FILETYPES_PYTHON]->pattern = g_new0(gchar*, 3); - filetypes[GEANY_FILETYPES_PYTHON]->pattern[0] = g_strdup("*.py"); - filetypes[GEANY_FILETYPES_PYTHON]->pattern[1] = g_strdup("*.pyw"); - filetypes[GEANY_FILETYPES_PYTHON]->pattern[2] = NULL; + filetypes[GEANY_FILETYPES_PYTHON]->pattern = utils_strv_new("*.py", "*.pyw", NULL); filetypes[GEANY_FILETYPES_PYTHON]->style_func_ptr = styleset_python; filetypes[GEANY_FILETYPES_PYTHON]->comment_open = g_strdup("#"); filetypes[GEANY_FILETYPES_PYTHON]->comment_close = NULL; @@ -394,10 +344,7 @@ filetypes[GEANY_FILETYPES_RUBY]->has_tags = TRUE; filetypes[GEANY_FILETYPES_RUBY]->title = g_strdup(_("Ruby source file")); filetypes[GEANY_FILETYPES_RUBY]->extension = g_strdup("rb"); - filetypes[GEANY_FILETYPES_RUBY]->pattern = g_new0(gchar*, 3); - filetypes[GEANY_FILETYPES_RUBY]->pattern[0] = g_strdup("*.rb"); - filetypes[GEANY_FILETYPES_RUBY]->pattern[1] = g_strdup("*.rhtml"); - filetypes[GEANY_FILETYPES_RUBY]->pattern[2] = NULL; + filetypes[GEANY_FILETYPES_RUBY]->pattern = utils_strv_new("*.rb", "*.rhtml", NULL); filetypes[GEANY_FILETYPES_RUBY]->style_func_ptr = styleset_ruby; filetypes[GEANY_FILETYPES_RUBY]->comment_open = g_strdup("#"); filetypes[GEANY_FILETYPES_RUBY]->comment_close = NULL; @@ -414,11 +361,7 @@ filetypes[GEANY_FILETYPES_TCL]->has_tags = TRUE; filetypes[GEANY_FILETYPES_TCL]->title = g_strdup(_("Tcl source file")); filetypes[GEANY_FILETYPES_TCL]->extension = g_strdup("tcl"); - filetypes[GEANY_FILETYPES_TCL]->pattern = g_new0(gchar*, 4); - filetypes[GEANY_FILETYPES_TCL]->pattern[0] = g_strdup("*.tcl"); - filetypes[GEANY_FILETYPES_TCL]->pattern[1] = g_strdup("*.tk"); - filetypes[GEANY_FILETYPES_TCL]->pattern[2] = g_strdup("*.wish"); - filetypes[GEANY_FILETYPES_TCL]->pattern[3] = NULL; + filetypes[GEANY_FILETYPES_TCL]->pattern = utils_strv_new("*.tcl", "*.tk", "*.wish", NULL); filetypes[GEANY_FILETYPES_TCL]->style_func_ptr = styleset_tcl; filetypes[GEANY_FILETYPES_TCL]->comment_open = g_strdup("#"); filetypes[GEANY_FILETYPES_TCL]->comment_close = NULL; @@ -435,9 +378,7 @@ filetypes[GEANY_FILETYPES_LUA]->has_tags = TRUE; filetypes[GEANY_FILETYPES_LUA]->title = g_strdup(_("Lua source file")); filetypes[GEANY_FILETYPES_LUA]->extension = g_strdup("lua"); - filetypes[GEANY_FILETYPES_LUA]->pattern = g_new0(gchar*, 2); - filetypes[GEANY_FILETYPES_LUA]->pattern[0] = g_strdup("*.lua"); - filetypes[GEANY_FILETYPES_LUA]->pattern[1] = NULL; + filetypes[GEANY_FILETYPES_LUA]->pattern = utils_strv_new("*.lua", NULL); filetypes[GEANY_FILETYPES_LUA]->style_func_ptr = styleset_lua; filetypes[GEANY_FILETYPES_LUA]->comment_open = g_strdup("--"); filetypes[GEANY_FILETYPES_LUA]->comment_close = NULL; @@ -454,9 +395,7 @@ filetypes[GEANY_FILETYPES_FERITE]->has_tags = TRUE; filetypes[GEANY_FILETYPES_FERITE]->title = g_strdup(_("Ferite source file")); filetypes[GEANY_FILETYPES_FERITE]->extension = g_strdup("fe"); - filetypes[GEANY_FILETYPES_FERITE]->pattern = g_new0(gchar*, 2); - filetypes[GEANY_FILETYPES_FERITE]->pattern[0] = g_strdup("*.fe"); - filetypes[GEANY_FILETYPES_FERITE]->pattern[1] = NULL; + filetypes[GEANY_FILETYPES_FERITE]->pattern = utils_strv_new("*.fe", NULL); filetypes[GEANY_FILETYPES_FERITE]->style_func_ptr = styleset_ferite; filetypes[GEANY_FILETYPES_FERITE]->comment_open = g_strdup("/*"); filetypes[GEANY_FILETYPES_FERITE]->comment_close = g_strdup("*/"); @@ -473,15 +412,8 @@ filetypes[GEANY_FILETYPES_SH]->has_tags = TRUE; filetypes[GEANY_FILETYPES_SH]->title = g_strdup(_("Shell script file")); filetypes[GEANY_FILETYPES_SH]->extension = g_strdup("sh"); - filetypes[GEANY_FILETYPES_SH]->pattern = g_new0(gchar*, 8); - filetypes[GEANY_FILETYPES_SH]->pattern[0] = g_strdup("*.sh"); - filetypes[GEANY_FILETYPES_SH]->pattern[1] = g_strdup("configure"); - filetypes[GEANY_FILETYPES_SH]->pattern[2] = g_strdup("configure.in"); - filetypes[GEANY_FILETYPES_SH]->pattern[3] = g_strdup("configure.in.in"); - filetypes[GEANY_FILETYPES_SH]->pattern[4] = g_strdup("configure.ac"); - filetypes[GEANY_FILETYPES_SH]->pattern[5] = g_strdup("*.ksh"); - filetypes[GEANY_FILETYPES_SH]->pattern[6] = g_strdup("*.zsh"); - filetypes[GEANY_FILETYPES_SH]->pattern[7] = NULL; + filetypes[GEANY_FILETYPES_SH]->pattern = utils_strv_new("*.sh", "configure", "configure.in", + "configure.in.in", "configure.ac", "*.ksh", "*.zsh", NULL); filetypes[GEANY_FILETYPES_SH]->style_func_ptr = styleset_sh; filetypes[GEANY_FILETYPES_SH]->comment_open = g_strdup("#"); filetypes[GEANY_FILETYPES_SH]->comment_close = NULL; @@ -534,9 +466,7 @@ filetypes[GEANY_FILETYPES_DOCBOOK]->has_tags = TRUE; filetypes[GEANY_FILETYPES_DOCBOOK]->title = g_strdup(_("Docbook source file")); filetypes[GEANY_FILETYPES_DOCBOOK]->extension = g_strdup("docbook"); - filetypes[GEANY_FILETYPES_DOCBOOK]->pattern = g_new0(gchar*, 2); - filetypes[GEANY_FILETYPES_DOCBOOK]->pattern[0] = g_strdup("*.docbook"); - filetypes[GEANY_FILETYPES_DOCBOOK]->pattern[1] = NULL; + filetypes[GEANY_FILETYPES_DOCBOOK]->pattern = utils_strv_new("*.docbook", NULL); filetypes[GEANY_FILETYPES_DOCBOOK]->style_func_ptr = styleset_docbook; filetypes[GEANY_FILETYPES_DOCBOOK]->comment_open = g_strdup("<!--"); filetypes[GEANY_FILETYPES_DOCBOOK]->comment_close = g_strdup("-->"); @@ -571,9 +501,7 @@ filetypes[GEANY_FILETYPES_CSS]->has_tags = TRUE; filetypes[GEANY_FILETYPES_CSS]->title = g_strdup(_("Cascading StyleSheet")); filetypes[GEANY_FILETYPES_CSS]->extension = g_strdup("css"); - filetypes[GEANY_FILETYPES_CSS]->pattern = g_new0(gchar*, 2); - filetypes[GEANY_FILETYPES_CSS]->pattern[0] = g_strdup("*.css"); - filetypes[GEANY_FILETYPES_CSS]->pattern[1] = NULL; + filetypes[GEANY_FILETYPES_CSS]->pattern = utils_strv_new("*.css", NULL); filetypes[GEANY_FILETYPES_CSS]->style_func_ptr = styleset_css; filetypes[GEANY_FILETYPES_CSS]->comment_open = g_strdup("/*"); filetypes[GEANY_FILETYPES_CSS]->comment_close = g_strdup("*/"); @@ -590,9 +518,7 @@ filetypes[GEANY_FILETYPES_SQL]->has_tags = TRUE; filetypes[GEANY_FILETYPES_SQL]->title = g_strdup(_("SQL Dump file")); filetypes[GEANY_FILETYPES_SQL]->extension = g_strdup("sql"); - filetypes[GEANY_FILETYPES_SQL]->pattern = g_new0(gchar*, 2); - filetypes[GEANY_FILETYPES_SQL]->pattern[0] = g_strdup("*.sql"); - filetypes[GEANY_FILETYPES_SQL]->pattern[1] = NULL; + filetypes[GEANY_FILETYPES_SQL]->pattern = utils_strv_new("*.sql", NULL); filetypes[GEANY_FILETYPES_SQL]->style_func_ptr = styleset_sql; filetypes[GEANY_FILETYPES_SQL]->comment_open = g_strdup("/*"); filetypes[GEANY_FILETYPES_SQL]->comment_close = g_strdup("*/"); @@ -609,11 +535,7 @@ filetypes[GEANY_FILETYPES_LATEX]->has_tags = TRUE; filetypes[GEANY_FILETYPES_LATEX]->title = g_strdup(_("LaTeX source file")); filetypes[GEANY_FILETYPES_LATEX]->extension = g_strdup("tex"); - filetypes[GEANY_FILETYPES_LATEX]->pattern = g_new0(gchar*, 4); - filetypes[GEANY_FILETYPES_LATEX]->pattern[0] = g_strdup("*.tex"); - filetypes[GEANY_FILETYPES_LATEX]->pattern[1] = g_strdup("*.sty"); - filetypes[GEANY_FILETYPES_LATEX]->pattern[2] = g_strdup("*.idx"); - filetypes[GEANY_FILETYPES_LATEX]->pattern[3] = NULL; + filetypes[GEANY_FILETYPES_LATEX]->pattern = utils_strv_new("*.tex", "*.sty", "*.idx", NULL); filetypes[GEANY_FILETYPES_LATEX]->style_func_ptr = styleset_latex; filetypes[GEANY_FILETYPES_LATEX]->comment_open = g_strdup("%"); filetypes[GEANY_FILETYPES_LATEX]->comment_close = NULL; @@ -630,9 +552,7 @@ filetypes[GEANY_FILETYPES_OMS]->has_tags = FALSE; filetypes[GEANY_FILETYPES_OMS]->title = g_strdup(_("O-Matrix source file")); filetypes[GEANY_FILETYPES_OMS]->extension = g_strdup("oms"); - filetypes[GEANY_FILETYPES_OMS]->pattern = g_new0(gchar*, 2); - filetypes[GEANY_FILETYPES_OMS]->pattern[0] = g_strdup("*.oms"); - filetypes[GEANY_FILETYPES_OMS]->pattern[1] = NULL; + filetypes[GEANY_FILETYPES_OMS]->pattern = utils_strv_new("*.oms", NULL); filetypes[GEANY_FILETYPES_OMS]->style_func_ptr = styleset_oms; filetypes[GEANY_FILETYPES_OMS]->comment_open = g_strdup("#"); filetypes[GEANY_FILETYPES_OMS]->comment_close = NULL; @@ -649,10 +569,7 @@ filetypes[GEANY_FILETYPES_VHDL]->has_tags = TRUE; filetypes[GEANY_FILETYPES_VHDL]->title = g_strdup(_("VHDL source file")); filetypes[GEANY_FILETYPES_VHDL]->extension = g_strdup("vhd"); - filetypes[GEANY_FILETYPES_VHDL]->pattern = g_new0(gchar*, 3); - filetypes[GEANY_FILETYPES_VHDL]->pattern[0] = g_strdup("*.vhd"); - filetypes[GEANY_FILETYPES_VHDL]->pattern[1] = g_strdup("*.vhdl"); - filetypes[GEANY_FILETYPES_VHDL]->pattern[2] = NULL; + filetypes[GEANY_FILETYPES_VHDL]->pattern = utils_strv_new("*.vhd", "*.vhdl", NULL); filetypes[GEANY_FILETYPES_VHDL]->style_func_ptr = styleset_vhdl; filetypes[GEANY_FILETYPES_VHDL]->comment_open = g_strdup("--"); filetypes[GEANY_FILETYPES_VHDL]->comment_close = NULL; @@ -686,13 +603,8 @@ filetypes[GEANY_FILETYPES_CONF]->has_tags = TRUE; filetypes[GEANY_FILETYPES_CONF]->title = g_strdup(_("Config file")); filetypes[GEANY_FILETYPES_CONF]->extension = g_strdup("conf"); - filetypes[GEANY_FILETYPES_CONF]->pattern = g_new0(gchar*, 6); - filetypes[GEANY_FILETYPES_CONF]->pattern[0] = g_strdup("*.conf"); - filetypes[GEANY_FILETYPES_CONF]->pattern[1] = g_strdup("*.ini"); - filetypes[GEANY_FILETYPES_CONF]->pattern[2] = g_strdup("config"); - filetypes[GEANY_FILETYPES_CONF]->pattern[3] = g_strdup("*rc"); - filetypes[GEANY_FILETYPES_CONF]->pattern[4] = g_strdup("*.cfg"); - filetypes[GEANY_FILETYPES_CONF]->pattern[5] = NULL; + filetypes[GEANY_FILETYPES_CONF]->pattern = utils_strv_new("*.conf", "*.ini", "config", "*rc", + "*.cfg", NULL); filetypes[GEANY_FILETYPES_CONF]->style_func_ptr = styleset_conf; filetypes[GEANY_FILETYPES_CONF]->comment_open = g_strdup("#"); filetypes[GEANY_FILETYPES_CONF]->comment_close = NULL; @@ -709,9 +621,7 @@ filetypes[GEANY_FILETYPES_ALL]->has_tags = FALSE; filetypes[GEANY_FILETYPES_ALL]->title = g_strdup(_("All files")); filetypes[GEANY_FILETYPES_ALL]->extension = g_strdup("*"); - filetypes[GEANY_FILETYPES_ALL]->pattern = g_new0(gchar*, 2); - filetypes[GEANY_FILETYPES_ALL]->pattern[0] = g_strdup("*"); - filetypes[GEANY_FILETYPES_ALL]->pattern[1] = NULL; + filetypes[GEANY_FILETYPES_ALL]->pattern = utils_strv_new("*", NULL); filetypes[GEANY_FILETYPES_ALL]->style_func_ptr = styleset_none; filetypes[GEANY_FILETYPES_ALL]->comment_open = NULL; filetypes[GEANY_FILETYPES_ALL]->comment_close = NULL;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.