*/
char *convert_utf8_to_ucs2(char *input, int *real_strlen);
-/*
+/**
* This function resolves ~ in pathnames.
* It may resolve wildcards in the first part of the path, but if no match
* or multiple matches are found, it just returns a copy of path as given.
*/
char *resolve_tilde(const char *path);
-/*
+/**
* Checks if the given path exists by calling stat().
*
*/
bool path_exists(const char *path);
-/*
+
+/**
+ * Returns the name of a temporary file with the specified prefix.
+ *
+ */
+char *get_process_filename(const char *prefix);
+
+/**
* Restart i3 in-place
* appends -a to argument list to disable autostart
*
exit(0);
}
- if (config.ipc_socket_path == NULL) {
+ if (config.ipc_socket_path == NULL)
config.ipc_socket_path = getenv("I3SOCK");
- if (config.ipc_socket_path == NULL)
- config.ipc_socket_path = get_process_filename("i3-ipc-socket");
- }
+
+ /* Fall back to a file name in /tmp/ based on the PID */
+ if (config.ipc_socket_path == NULL)
+ config.ipc_socket_path = get_process_filename("i3-ipc-socket");
uint32_t mask = XCB_CW_EVENT_MASK;
uint32_t values[] = { XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT |
* Returns the name of a temporary file with the specified prefix.
*
*/
-char *get_process_filename(const char *prefix)
-{
+char *get_process_filename(const char *prefix) {
struct passwd *pw = getpwuid(getuid());
const char *username = pw ? pw->pw_name : "unknown";
char *filename;
perror("asprintf()");
return NULL;
}
- else {
- return filename;
- }
+
+ return filename;
}
#define y(x, ...) yajl_gen_ ## x (gen, ##__VA_ARGS__)