Merge branch 'master' into bar_hiding

This commit is contained in:
calvinkosmatka 2017-04-16 15:16:18 -05:00 committed by GitHub
commit 904f004bc9
17 changed files with 238 additions and 61 deletions

View file

@ -19,15 +19,18 @@ void sway_log_colors(int mode);
void sway_log_errno(log_importance_t verbosity, char* format, ...) __attribute__((format(printf,2,3)));
void sway_abort(const char* format, ...) __attribute__((format(printf,1,2)));
bool _sway_assert(bool condition, const char* format, ...) __attribute__((format(printf,2,3)));
bool _sway_assert(bool condition, const char *filename, int line, const char* format, ...) __attribute__((format(printf,4,5)));
#define sway_assert(COND, FMT, ...) \
_sway_assert(COND, "%s:" FMT, __PRETTY_FUNCTION__, ##__VA_ARGS__)
_sway_assert(COND, __FILE__, __LINE__, "%s:" FMT, __PRETTY_FUNCTION__, ##__VA_ARGS__)
void _sway_log(const char *filename, int line, log_importance_t verbosity, const char* format, ...) __attribute__((format(printf,4,5)));
#define sway_log(VERBOSITY, FMT, ...) \
_sway_log(__FILE__, __LINE__, VERBOSITY, FMT, ##__VA_ARGS__)
#define sway_vlog(VERBOSITY, FMT, VA_ARGS) \
_sway_vlog(__FILE__, __LINE__, VERBOSITY, FMT, VA_ARGS)
void error_handler(int sig);
#endif

View file

@ -3,9 +3,11 @@
#include <unistd.h>
#include "sway/config.h"
uint32_t get_feature_policy(pid_t pid);
uint32_t get_ipc_policy(pid_t pid);
uint32_t get_command_policy(const char *cmd);
uint32_t get_feature_policy_mask(pid_t pid);
uint32_t get_ipc_policy_mask(pid_t pid);
uint32_t get_command_policy_mask(const char *cmd);
struct feature_policy *get_feature_policy(const char *name);
const char *command_policy_str(enum command_context context);

View file

@ -49,4 +49,12 @@ pid_t get_parent_pid(pid_t pid);
*/
uint32_t parse_color(const char *color);
/**
* Given a path string, recurseively resolves any symlinks to their targets
* (which may be a file, directory) and returns the result.
* argument is returned. Caller must free the returned buffer.
* If an error occures, if the path does not exist or if the path corresponds
* to a dangling symlink, NULL is returned.
*/
char* resolve_path(const char* path);
#endif