contrib/chg/procutil.h
author Boris Feld <boris.feld@octobus.net>
Thu, 05 Oct 2017 17:42:56 +0200
changeset 34847 e27f1f04c2cf
parent 31941 ac5527021097
permissions -rw-r--r--
templatekw: introduce obsfate keyword Introduce an obsfate printer that uses all helpers functions defined in obsutil to get all the obsfate-related data and format a string according to the current format in test-obsmarker-template.t. Then, introduce an obsfate templatekw that uses the obsfateprinter to return a list of strings. The goal is not to replace existing obsfate template functions but to propose a default, good-enough and easily usable obsfate definition for end-users that don't want to customize it. Such output would ultimately get included in the default log output. Here are some output examples for a commit amended: rewritten using amend as 5:a9b1f8652753 by test (at 1970-01-01 00:00 +0000) Next patches will make the output dependent on the verbosity. Exemple of use-cases: For having the obsfate on a single-line between brackets: {if(obsfate, " [{join(obsfate, "; ")}]")} For having the obsfate in several lines: {if(obsfate, "{obsfate % " Obsfate: {fate}\n"}")}
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
30693
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents:
diff changeset
     1
/*
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents:
diff changeset
     2
 * Utilities about process handling - signal and subprocess (ex. pager)
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents:
diff changeset
     3
 *
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents:
diff changeset
     4
 * Copyright (c) 2011 Yuya Nishihara <yuya@tcha.org>
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents:
diff changeset
     5
 *
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents:
diff changeset
     6
 * This software may be used and distributed according to the terms of the
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents:
diff changeset
     7
 * GNU General Public License version 2 or any later version.
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents:
diff changeset
     8
 */
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents:
diff changeset
     9
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents:
diff changeset
    10
#ifndef PROCUTIL_H_
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents:
diff changeset
    11
#define PROCUTIL_H_
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents:
diff changeset
    12
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents:
diff changeset
    13
#include <unistd.h>
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents:
diff changeset
    14
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents:
diff changeset
    15
void restoresignalhandler(void);
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents:
diff changeset
    16
void setupsignalhandler(pid_t pid, pid_t pgid);
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents:
diff changeset
    17
31941
ac5527021097 chg: respect environment variables for pager
Jun Wu <quark@fb.com>
parents: 30693
diff changeset
    18
pid_t setuppager(const char *pagercmd, const char *envp[]);
30693
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents:
diff changeset
    19
void waitpager(void);
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents:
diff changeset
    20
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents:
diff changeset
    21
#endif /* PROCUTIL_H_ */