summary refs log tree commit diff stats
path: root/doc/ranger.1
Commit message (Expand)AuthorAgeFilesLines
* manpage: renamed example/ to /usr/share/doc/ranger/hut2013-03-091-5/+6
* settingobject: remove complexity of shorten_title settinghut2013-03-011-3/+3
* doc/ranger.1: removed obsolete reference to fm.envhut2013-03-011-1/+1
* doc/ranger.1: documented :scout commandhut2013-03-011-1/+26
* doc/ranger.1: Fixed --copy-config documentationhut2013-02-281-2/+2
* Merge branch 'vcs'hut2013-02-241-0/+12
|\
| * Merge branch 'master' into vcshut2013-02-221-44/+51
| |\
| * \ Merge branch 'master' into vcshut2013-02-191-0/+3
| |\ \
| * \ \ Merge branch 'master' into vcshut2013-02-181-41/+47
| |\ \ \
| * | | | document config options for vcs on the man pageAbdo Roig-Maranges2013-02-171-5/+10
| * | | | Rebuilt manpageAbdo Roig-Maranges2013-02-121-1/+8
* | | | | Fire in the Hole! v1.6.0hut2013-02-221-1/+1
| |_|_|/ |/| | |
* | | | core.main: added RANGER_LOAD_DEFAULT_RC environment variablehut2013-02-221-0/+5
* | | | doc/ranger.1: update ENVIRONMENT sectionhut2013-02-221-4/+2
* | | | doc/ranger.1: typohut2013-02-221-1/+1
* | | | doc/ranger.1: added chmod key bindings to man pagehut2013-02-221-0/+4
* | | | doc/ranger.1: remove midnight commander bindings from man pagehut2013-02-221-26/+0
* | | | doc/ranger.1: update KEY BINDINGS sectionhut2013-02-221-11/+25
* | | | doc/ranger.1: updated the CONCEPTS sectionhut2013-02-221-2/+14
| |_|/ |/| |
* | | doc/rifle.1: added whitespace at exampleshut2013-02-181-0/+3
| |/ |/|
* | README: removed bash dependencyhut2013-02-181-1/+1
* | ranger.1: update list of ranger optionshut2013-02-181-8/+17
* | ranger.1: added missing docs of settingshut2013-02-181-1/+8
* | ranger.__init__: change [path/filename] to [path] in USAGEhut2013-02-181-1/+1
* | ranger.1: update doc of :open_withhut2013-02-181-3/+2
* | doc/ranger.1: update doc of :chmod, :delete, :find, :save_copy_bufferhut2013-02-181-14/+11
* | doc/ranger.1: fully removed --mode and --flags from man pagehut2013-02-171-9/+0
* | doc/ranger.1: added :travel to man pagehut2013-02-171-0/+8
* | core.main: made --mode and --flag deprecatedhut2013-02-171-2/+1
* | core.main: made --fail-unless-cd deprecatedhut2013-02-171-6/+2
|/
* config/commands: Added commands 'mark_tag' and 'unmark_tag'hut2013-01-011-1/+11
* container.settingobject: added setting "update_tmux_title"hut2012-12-101-1/+4
* added setlocal command to handle local settingsAbdó Roig-Maranges2012-12-091-2/+8
* config/rc.conf: Added setting "confirm_on_delete"hut2012-12-061-1/+6
* doc/ranger.1: typohut2012-12-041-1/+1
* doc/ranger.1: add a warning about overwriting hookshut2012-12-041-2/+5
* updated man page, improved hookshut2012-12-041-39/+78
* update documentation for commandshut2012-12-041-25/+80
* update documentation for options, plugins and exampleshut2012-12-041-88/+67
* Merge branch 'stable'hut2012-08-101-1/+1
|\
| * ceci n'est pas un nouveau version v1.5.5hut2012-08-101-2/+2
* | doc/ranger.1: rebuilt man pagehut2012-08-021-5/+5
|/
* What kind of idiot invented bugs anyway? v1.5.4hut2012-05-031-2/+2
* Always remember to bring your towel. v1.5.3hut2012-03-051-1/+1
* Added $RANGER_LEVEL environment variable (see man page)hut2012-03-051-0/+13
* Removed unnecessary spaceshut2012-03-051-2/+2
* ranger.1: fix vim script "RangerChooser" when no file is openedhut2012-02-211-2/+2
* ranger.1: Added entry for --list-tagged-fileshut2012-02-121-0/+4
* core.main: Allow multiple --cmd's, add man page entry for --cmdhut2012-02-121-1/+5
* new :relink commandM Rawash2012-01-271-0/+8
r: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * common.h
 *
 * Copyright (C) 2012, 2013 James Booth <boothj5@gmail.com>
 *
 * This file is part of Profanity.
 *
 * Profanity is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Profanity is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Profanity.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef COMMON_H
#define COMMON_H

#include <stdio.h>

#include <glib.h>

#if !GLIB_CHECK_VERSION(2,28,0)
#define g_slist_free_full(items, free_func)         p_slist_free_full(items, free_func)
#endif

#if !GLIB_CHECK_VERSION(2,30,0)
#define g_utf8_substring(str, start_pos, end_pos)   p_utf8_substring(str, start_pos, end_pos)
#endif

#ifndef NOTIFY_CHECK_VERSION
#define notify_notification_new(summary, body, icon) notify_notification_new(summary, body, icon, NULL)
#endif

#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))

#define FREE_SET_NULL(resource) \
{ \
    if (resource != NULL) { \
        free(resource); \
        resource = NULL; \
    } \
}

#define GFREE_SET_NULL(resource) \
{ \
    g_free(resource); \
    resource = NULL; \
}

typedef enum {
    CONTACT_OFFLINE,
    CONTACT_ONLINE,
    CONTACT_AWAY,
    CONTACT_DND,
    CONTACT_CHAT,
    CONTACT_XA
} contact_presence_t;

typedef enum {
    RESOURCE_ONLINE,
    RESOURCE_AWAY,
    RESOURCE_DND,
    RESOURCE_CHAT,
    RESOURCE_XA
} resource_presence_t;

gchar* p_utf8_substring(const gchar *str, glong start_pos, glong end_pos);
void p_slist_free_full(GSList *items, GDestroyNotify free_func);
void create_dir(char *name);
void mkdir_recursive(const char *dir);
char * str_replace(const char *string, const char *substr,
    const char *replacement);
int str_contains(char str[], int size, char ch);
char* encode_xml(const char * const xml);
char * prof_getline(FILE *stream);
int octet_compare(unsigned char *str1, unsigned char *str2);
char* release_get_latest(void);
gboolean release_is_new(char *found_version);
gchar * xdg_get_config_home(void);
gchar * xdg_get_data_home(void);

gboolean valid_resource_presence_string(const char * const str);
const char * string_from_resource_presence(resource_presence_t presence);
resource_presence_t resource_presence_from_string(const char * const str);
contact_presence_t contact_presence_from_resource_presence(resource_presence_t resource_presence);

#endif