Revision: 5113 http://geany.svn.sourceforge.net/geany/?rev=5113&view=rev Author: eht16 Date: 2010-08-01 10:23:19 +0000 (Sun, 01 Aug 2010)
Log Message: ----------- Add utils_get_eol_char().
Modified Paths: -------------- trunk/ChangeLog trunk/src/utils.c trunk/src/utils.h
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-07-31 15:31:30 UTC (rev 5112) +++ trunk/ChangeLog 2010-08-01 10:23:19 UTC (rev 5113) @@ -1,3 +1,9 @@ +2010-08-01 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> + + * src/utils.c, src/utils.h: + Add utils_get_eol_char(). + + 2010-07-31 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/vte.c:
Modified: trunk/src/utils.c =================================================================== --- trunk/src/utils.c 2010-07-31 15:31:30 UTC (rev 5112) +++ trunk/src/utils.c 2010-08-01 10:23:19 UTC (rev 5113) @@ -128,6 +128,9 @@ guint cr, lf, crlf, max_mode; gint mode;
+ if (size == -1) + size = strlen(buffer); + cr = lf = crlf = 0;
for (i = 0; i < size ; i++) @@ -342,6 +345,17 @@ }
+const gchar *utils_get_eol_char(gint eol_mode) +{ + switch (eol_mode) + { + case SC_EOL_CRLF: return "\r\n"; break; + case SC_EOL_CR: return "\r"; break; + default: return "\n"; break; + } +} + + gboolean utils_atob(const gchar *str) { if (G_UNLIKELY(str == NULL))
Modified: trunk/src/utils.h =================================================================== --- trunk/src/utils.h 2010-07-31 15:31:30 UTC (rev 5112) +++ trunk/src/utils.h 2010-08-01 10:23:19 UTC (rev 5113) @@ -127,6 +127,8 @@
gchar *utils_find_open_xml_tag(const gchar sel[], gint size, gboolean check_tag);
+const gchar *utils_get_eol_char(gint eol_mode); + const gchar *utils_get_eol_name(gint eol_mode);
gboolean utils_atob(const gchar *str);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.