summaryrefslogtreecommitdiff
path: root/src/lib-config/write.c
AgeCommit message (Collapse)Author
2018-04-08Make config_write more atomic to prevent truncation when out of spacedequis
This is modeled after glib's g_file_set_contents. It doesn't use that function directly because the writing is done with GIOChannel streaming-like writes and g_file_set_contents expects the whole thing to be in-memory. Main differences with g_file_set_contents: - complete lack of win32 special casing (cygwin/WSL should work though) - no fallocate() (linux only, but we don't know the size upfront, anyway) - always calls fsync (glib skips it on btrfs or when not overwriting) Other than that, it's the same old mkstemp + fsync + rename.
2009-10-23Add forgotten g_io_channel_set_close_on_unref call to close the config file fdEmanuele Giaquinta
after saving, patch by Sven Wegener. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5101 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-02-08Code Cleanup:Alexander Færøy
Use g_string_append_printf() instead of g_string_sprintfa() (which is considered deprecated.) git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5003 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-01-16Use an io channel to write the config file.Emanuele Giaquinta
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4990 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-11-12Simplify, use 'o' printf conversion specifier to print number in octal.Emanuele Giaquinta
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4904 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-03-11Keep documentation for public api only in headers to avoid duplication.Emanuele Giaquinta
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4755 dbcabf3a-b0e7-0310-adc4-f8d773084564
2007-05-08Oops. Update address correctly now.Wouter Coekaerts
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4490 dbcabf3a-b0e7-0310-adc4-f8d773084564
2007-05-08Update FSF addressWouter Coekaerts
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4489 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-01-27toupper(), tolower(), isspace(), is..etc..() aren't safe with chars in someTimo Sirainen
systems, use our own is_...() functions now instead. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2348 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-01-07Don't write indent spaces to empty linesTimo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1085 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-12-16Config file handle wasn't closed if config_write_block() failedTimo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@993 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-06-14If name tag contains '_', it shouldn't be quoted.Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@333 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-04-26rest of the ~rewrite?Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@172 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-04-14Sorry for a big update - I still don't have internet connection at homeTimo Sirainen
and this is what I've been doing a few weeks now.. :) You really shouldn't upgrade to this version without keeping a backup of the working one, since this will break everything and at least notify list is broken - probably something else too. * On the way to 0.8.0 .. Major rewriting/rearranging code. There's some changes in behaviour because I'm trying to make Irssi a bit more compatible with EPIC. * libPropList isn't needed anymore - I'm using my own configuration library. This is mostly because different proplists worked a bit differently everywhere and several people had problems with it. It's also yet another extra library that you needed to compile Irssi. New configuration library has several advantages: You can add comments to configuration file and they also stay there when it's saved. It's not nearly as vulnerable as proplist. If some error occurs, instead of just not reading anything it will try to continue if possible. Also the error messages are written to irssi's text window instead of stdout. It can be managed more easily than proplist - setting/getting the configuration is a lot more easier. * Coding style changes - I'm not using gint, gchar etc. anymore, they're just extra pain when moving code to non-glib projects and syntax hilighting doesn't work by default with most editors ;) Indentation style was also changed to K&R because of some political reasons ;) And I'm already starting to like it.. :) It forces me to split code to different functions more often and the result is that the code gets more readable. And finally I'm also using nst' all over the place. + /EVAL <commands> - Expand all the special variables from string and run it. Commands can be split with ; character. See docs/SPECIAL_VARS for more info. + Aliases are parsed just like /EVAL - arguments are in $0..$9. + Text formats are also parsed like /EVAL, arguments used to be in $1..$9, now they're in $0..$8 so it messes up existing themes.. + /SET [key [value]] - no more the '=' character. Boolean values also need to be changed with ON/OFF/TOGGLE values (not yes/no). Settings aren't saved to disk until you use /SAVE. + /TOGGLE <key> [ON/OFF] - same as /SET <key> TOGGLE git-svn-id: http://svn.irssi.org/repos/irssi/trunk@163 dbcabf3a-b0e7-0310-adc4-f8d773084564