1
0
forked from drath/libratbag

Compare commits

..

14 Commits
v0.2 ... v0.3

Author SHA1 Message Date
Benjamin Tissoires
efd15a33fb configure.ac: libratbag 0.3
Soname bump for liblur and libratbag as they were not properly versioned.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01 17:04:39 +01:00
Benjamin Tissoires
b804e117c1 hidpp20drv: fix segfault when a device is not powered on
We were returning 0 and libratbag tried to access the profiles afterward.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01 16:59:32 +01:00
Benjamin Tissoires
b54d28ec1a tools: add a man for ratbag-command
Just duplicated the help.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01 16:46:31 +01:00
Benjamin Tissoires
388dae76bc libratbag.sym: bump symbols version
0.1.0 never existed, the first release was 0.2 :)

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01 15:35:33 +01:00
Benjamin Tissoires
19f87790bb Add liblur versioning and pkg-config
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2016-03-01 15:34:46 +01:00
Benjamin Tissoires
9aa8938eb8 hidpp20: profiles: make sure the mouse is in the profiles mode, not HID
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01 15:05:50 +01:00
Benjamin Tissoires
25094daaed hidpp20: profiles: make sure device is compatible with our implementation
Get_Profile_Info gives valuable information to know if we are compatible
with a given device. Use it and bail out if we are not able to support
the device.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01 14:57:19 +01:00
Benjamin Tissoires
39069623f2 hidpp20drv: bail out if the features are not working as expected
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01 14:36:03 +01:00
Benjamin Tissoires
d5c74682f1 Add missing carriage return when the driver does not match
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01 14:32:42 +01:00
Benjamin Tissoires
6cba2abd8e hidpp20: reorder profile initialization
Spec says the profile count is stored in byte 3 of
CMD_ONBOARD_PROFILES_GET_PROFILES_DESCR, so use this to allocate the proper
number of profiles.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01 14:15:15 +01:00
Peter Hutterer
f58b91a9b2 When setting a button action, update our internal state on success
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2016-02-29 09:58:18 +10:00
Peter Hutterer
de08323609 Fix return for ratbag_button_get_special when we don't have a special action
Do what the doc says.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-24 10:51:28 +10:00
Peter Hutterer
5fcdfab2a6 Fix a doxygen ref
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-24 10:51:07 +10:00
Benjamin Tissoires
e07839bcee tools: remove no-install flag for lur-command
The resulting RPM complains about RPATH.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-02-18 14:25:18 +01:00
12 changed files with 385 additions and 33 deletions

View File

@@ -1,7 +1,7 @@
AC_PREREQ([2.64])
m4_define([libratbag_major_version], [0])
m4_define([libratbag_minor_version], [2])
m4_define([libratbag_minor_version], [3])
m4_define([libratbag_micro_version], [0])
m4_define([libratbag_version],
[libratbag_major_version.libratbag_minor_version.libratbag_micro_version])
@@ -22,16 +22,18 @@ AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
# Before making a release, the LIBRATBAG_LT_VERSION string should be
# modified.
# The string is of the form C:R:A.
# Before making a release, the LIBRATBAG_LT_VERSION and LIBLUR_LT_VERSION
# strings should be modified.
# The strings are of the form C:R:A.
# a) If binary compatibility has been broken (eg removed or changed interfaces)
# change to C+1:0:0.
# b) If interfaces have been changed or added, but binary compatibility has
# been preserved, change to C+1:0:A+1
# c) If the interface is the same as the previous version, change to C:R+1:A
LIBRATBAG_LT_VERSION=1:0:0
LIBRATBAG_LT_VERSION=2:0:0
LIBLUR_LT_VERSION=2:0:0
AC_SUBST(LIBRATBAG_LT_VERSION)
AC_SUBST(LIBLUR_LT_VERSION)
AM_SILENT_RULES([yes])
AC_USE_SYSTEM_EXTENSIONS
@@ -145,6 +147,7 @@ AC_CONFIG_FILES([Makefile
src/Makefile
src/libratbag.pc
src/libratbag-version.h
src/liblur.pc
test/Makefile
tools/Makefile])
AC_CONFIG_FILES([test/symbols-leak-test],

View File

@@ -44,15 +44,19 @@ liblur_la_LIBADD = \
liblur_la_CFLAGS = \
-I$(top_srcdir)/include \
$(GCC_CFLAGS)
liblur_la_LDFLAGS = -shared
EXTRA_liblur_la_DEPENDENCIES = $(srcdir)/liblur.sym
liblur_la_LDFLAGS = -version-info $(LIBLUR_LT_VERSION) -shared \
-Wl,--version-script=$(srcdir)/liblur.sym
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libratbag.pc
pkgconfig_DATA = libratbag.pc \
liblur.pc
AM_CFLAGS = $(GCC_CFLAGS)
DISTCLEANFILES = libratbag-version.h
EXTRA_DIST = libratbag-version.h.in libratbag.sym
EXTRA_DIST = libratbag-version.h.in libratbag.sym liblur.sym
# The hidpp libraries are static libraries only for in-tree tools. No API
# stability is guaranteed here.

View File

@@ -734,6 +734,7 @@ hidpp20drv_20_probe(struct ratbag_device *device)
struct hidpp20_device *dev = drv_data->dev;
struct hidpp20_feature *feature_list = dev->feature_list;
unsigned int i;
int rc;
log_raw(device->ratbag,
"'%s' has %d features\n",
@@ -744,7 +745,9 @@ hidpp20drv_20_probe(struct ratbag_device *device)
log_raw(device->ratbag, "Init feature %s (0x%04x) \n",
hidpp20_feature_get_name(feature_list[i].feature),
feature_list[i].feature);
hidpp20drv_init_feature(device, feature_list[i].feature);
rc = hidpp20drv_init_feature(device, feature_list[i].feature);
if (rc < 0)
return rc;
}
return 0;
@@ -794,6 +797,7 @@ hidpp20drv_probe(struct ratbag_device *device)
log_error(device->ratbag,
"Failed to get HID++2.0 device for %s\n",
device->name);
rc = -ENODEV;
goto err;
}

View File

@@ -907,6 +907,8 @@ int hidpp20_adjustable_dpi_set_sensor_dpi(struct hidpp20_device *device,
/* -------------------------------------------------------------------------- */
#define CMD_ONBOARD_PROFILES_GET_PROFILES_DESCR 0x00
#define CMD_ONBOARD_PROFILES_SET_ONBOARD_MODE 0x10
#define CMD_ONBOARD_PROFILES_GET_ONBOARD_MODE 0x20
#define CMD_ONBOARD_PROFILES_SET_CURRENT_PROFILE 0x30
#define CMD_ONBOARD_PROFILES_GET_CURRENT_PROFILE 0x40
#define CMD_ONBOARD_PROFILES_MEMORY_READ 0x50
@@ -920,6 +922,29 @@ int hidpp20_adjustable_dpi_set_sensor_dpi(struct hidpp20_device *device,
#define HIDPP20_PROFILE_SIZE HIDPP20_PAGE_SIZE
#define HIDPP20_BUTTON_HID 0x80
#define HIDPP20_MODE_NO_CHANGE 0x00
#define HIDPP20_ONBOARD_MODE 0x01
#define HIDPP20_HOST_MODE 0x02
#define HIDPP20_ONBOARD_PROFILES_MEMORY_TYPE_PROTOSS 0x01
#define HIDPP20_ONBOARD_PROFILES_PROFILE_TYPE_PROTOSS 0x01
#define HIDPP20_ONBOARD_PROFILES_MACRO_TYPE_PROTOSS 0x01
struct hidpp20_onboard_profiles_info {
uint8_t memory_model_id;
uint8_t profile_format_id;
uint8_t macro_format_id;
uint8_t profile_count;
uint8_t profile_count_oob;
uint8_t button_count;
uint8_t sector_count;
uint16_t sector_size;
uint8_t mechanical_layout;
uint8_t various_info;
uint8_t reserved[5];
} __attribute__((packed));
_Static_assert(sizeof(struct hidpp20_onboard_profiles_info) == 16, "Invalid size");
int
hidpp20_onboard_profiles_read_memory(struct hidpp20_device *device,
uint8_t read_rom,
@@ -1076,6 +1101,58 @@ hidpp20_onboard_profiles_write_page(struct hidpp20_device *device,
return hidpp20_onboard_profiles_write_data(device, page, 0x00, data, HIDPP20_PAGE_SIZE);
}
static int
hidpp20_onboard_profiles_get_onboard_mode(struct hidpp20_device *device)
{
uint8_t feature_index;
int rc;
union hidpp20_message msg = {
.msg.report_id = REPORT_ID_SHORT,
.msg.device_idx = device->index,
.msg.address = CMD_ONBOARD_PROFILES_GET_ONBOARD_MODE,
};
feature_index = hidpp_root_get_feature_idx(device,
HIDPP_PAGE_ONBOARD_PROFILES);
if (feature_index == 0)
return -ENOTSUP;
msg.msg.sub_id = feature_index;
rc = hidpp20_request_command(device, &msg);
if (rc)
return rc;
return msg.msg.parameters[0];
}
static int
hidpp20_onboard_profiles_set_onboard_mode(struct hidpp20_device *device,
uint8_t onboard_mode)
{
uint8_t feature_index;
int rc;
union hidpp20_message msg = {
.msg.report_id = REPORT_ID_SHORT,
.msg.device_idx = device->index,
.msg.address = CMD_ONBOARD_PROFILES_SET_ONBOARD_MODE,
.msg.parameters[1] = onboard_mode,
};
feature_index = hidpp_root_get_feature_idx(device,
HIDPP_PAGE_ONBOARD_PROFILES);
if (feature_index == 0)
return -ENOTSUP;
msg.msg.sub_id = feature_index;
rc = hidpp20_request_command(device, &msg);
if (rc)
return rc;
return 0;
}
int
hidpp20_onboard_profiles_get_current_profile(struct hidpp20_device *device)
{
@@ -1130,16 +1207,18 @@ hidpp20_onboard_profiles_set_current_profile(struct hidpp20_device *device,
static int
hidpp20_onboard_profiles_initialize(struct hidpp20_device *device,
unsigned profile_count,
struct hidpp20_profiles *profiles_list)
struct hidpp20_profiles **profiles_list)
{
uint8_t feature_index;
int rc;
struct hidpp20_profiles *profiles;
union hidpp20_message msg = {
.msg.report_id = REPORT_ID_SHORT,
.msg.device_idx = device->index,
.msg.address = CMD_ONBOARD_PROFILES_GET_PROFILES_DESCR,
};
struct hidpp20_onboard_profiles_info *info;
int onboard_mode;
feature_index = hidpp_root_get_feature_idx(device,
HIDPP_PAGE_ONBOARD_PROFILES);
@@ -1152,10 +1231,76 @@ hidpp20_onboard_profiles_initialize(struct hidpp20_device *device,
if (rc)
return rc;
profiles_list->num_buttons = msg.msg.parameters[5] <= 16 ? msg.msg.parameters[5] : 16;
profiles_list->num_profiles = profile_count;
/* FIXME: actually retrieve the correct values */
profiles_list->num_modes = 5;
info = (struct hidpp20_onboard_profiles_info *)msg.msg.parameters;
if (info->memory_model_id != HIDPP20_ONBOARD_PROFILES_MEMORY_TYPE_PROTOSS) {
hidpp_log_error(&device->base,
"Memory layout not supported: 0x%02x.\n",
info->memory_model_id);
return -ENOTSUP;
}
if (info->profile_format_id != HIDPP20_ONBOARD_PROFILES_PROFILE_TYPE_PROTOSS) {
hidpp_log_error(&device->base,
"Profile layout not supported: 0x%02x.\n",
info->profile_format_id);
return -ENOTSUP;
}
if (info->macro_format_id != HIDPP20_ONBOARD_PROFILES_MACRO_TYPE_PROTOSS) {
hidpp_log_error(&device->base,
"Macro format not supported: 0x%02x.\n",
info->macro_format_id);
return -ENOTSUP;
}
info->sector_size = hidpp_be_u16_to_cpu(info->sector_size);
if (info->sector_size != HIDPP20_PAGE_SIZE) {
hidpp_log_error(&device->base,
"Unsupported sector size: %d.\n",
info->sector_size);
return -ENOTSUP;
}
rc = hidpp20_onboard_profiles_get_onboard_mode(device);
if (rc < 0)
return rc;
onboard_mode = rc;
if (onboard_mode != HIDPP20_ONBOARD_MODE) {
hidpp_log_raw(&device->base,
"not on the correct mode: %d.\n",
onboard_mode);
rc = hidpp20_onboard_profiles_set_onboard_mode(device,
HIDPP20_ONBOARD_MODE);
if (rc < 0)
return rc;
}
profiles = zalloc(sizeof(struct hidpp20_profiles) +
info->profile_count * sizeof(struct hidpp20_profile));
profiles->num_profiles = info->profile_count;
profiles->num_buttons = msg.msg.parameters[5] <= 16 ? msg.msg.parameters[5] : 16;
profiles->num_modes = HIDPP20_DPI_COUNT;
profiles->has_g_shift = (info->mechanical_layout & 0x03) == 2;
profiles->has_dpi_shift = (info->mechanical_layout & 0x0c) == 2;
switch(info->various_info & 0x07) {
case 1:
profiles->corded = 1;
break;
case 2:
profiles->wireless = 1;
break;
case 4:
profiles->corded = 1;
profiles->wireless = 1;
break;
}
*profiles_list = profiles;
return 0;
}
@@ -1327,8 +1472,14 @@ hidpp20_onboard_profiles_allocate(struct hidpp20_device *device,
unsigned i;
int rc;
uint8_t data[16] = {0};
struct hidpp20_profiles *profiles;
unsigned profile_count = 0;
struct hidpp20_profiles *profiles = NULL;
rc = hidpp20_onboard_profiles_initialize(device,
&profiles);
if (rc < 0)
return rc;
assert(profiles);
rc = hidpp20_onboard_profiles_read_memory(device,
0x00,
@@ -1338,26 +1489,19 @@ hidpp20_onboard_profiles_allocate(struct hidpp20_device *device,
if (rc < 0)
return rc;
profiles = zalloc(sizeof(struct hidpp20_profiles));
for (i = 0; i < 3; i++) {
for (i = 0; i < profiles->num_profiles; i++) {
uint8_t *d = data + 4 * i;
if (d[0] == 0xFF && d[1] == 0xFF)
break;
profile_count++;
profiles->profiles[i].index = d[1];
profiles->profiles[i].enabled = d[2];
}
hidpp20_onboard_profiles_initialize(device,
profile_count,
profiles);
*profiles_list = profiles;
return profile_count;
return profiles->num_profiles;
}
void

View File

@@ -275,6 +275,8 @@ int hidpp20_adjustable_dpi_set_sensor_dpi(struct hidpp20_device *device,
#define HIDPP20_MODIFIER_KEY_CTRL 0x01
#define HIDPP20_MODIFIER_KEY_SHIFT 0x02
#define HIDPP20_DPI_COUNT 5
union hidpp20_button_binding {
struct {
uint8_t type;
@@ -353,7 +355,7 @@ struct hidpp20_profile {
unsigned report_rate;
unsigned default_dpi;
unsigned switched_dpi;
uint16_t dpi[5];
uint16_t dpi[HIDPP20_DPI_COUNT];
union hidpp20_button_binding buttons[32];
union hidpp20_macro_data *macros[32];
};
@@ -362,7 +364,11 @@ struct hidpp20_profiles {
uint8_t num_profiles;
uint8_t num_buttons;
uint8_t num_modes;
struct hidpp20_profile profiles[5];
uint8_t has_g_shift;
uint8_t has_dpi_shift;
uint8_t corded;
uint8_t wireless;
struct hidpp20_profile profiles[0];
};
/**

13
src/liblur.pc.in Normal file
View File

@@ -0,0 +1,13 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
datarootdir=@datarootdir@
pkgdatadir=@datadir@/@PACKAGE@
libdir=@libdir@
includedir=@includedir@
Name: Liblur
Description: Logitech Unifying Receiver configuration library
Version: @LIBRATBAG_VERSION@
Cflags: -I${includedir}
Libs: -L${libdir} -llur
Libs.private: -lm -lrt

25
src/liblur.sym Normal file
View File

@@ -0,0 +1,25 @@
/* in alphabetical order! */
LIBLUR_0.3.0 {
global:
lur_device_disconnect;
lur_device_get_name;
lur_device_get_product_id;
lur_device_get_serial;
lur_device_get_type;
lur_device_get_vendor_id;
lur_device_ref;
lur_device_unref;
lur_is_receiver;
lur_receiver_close;
lur_receiver_enumerate;
lur_receiver_get_fd;
lur_receiver_get_user_data;
lur_receiver_new_from_hidraw;
lur_receiver_open;
lur_receiver_ref;
lur_receiver_set_user_data;
lur_receiver_unref;
local:
*;
};

View File

@@ -314,7 +314,7 @@ ratbag_find_driver(struct ratbag_device *device,
device->driver = NULL;
if (rc != -ENODEV) {
log_error(ratbag, "%s: no hidraw device found", device->name);
log_error(ratbag, "%s: no hidraw device found\n", device->name);
return NULL;
}
@@ -952,6 +952,9 @@ ratbag_button_set_button(struct ratbag_button *button, unsigned int btn)
rc = button->profile->device->driver->write_button(button, &action);
if (rc == 0)
button->action = action;
return rc;
}
@@ -959,7 +962,7 @@ LIBRATBAG_EXPORT enum ratbag_button_action_special
ratbag_button_get_special(struct ratbag_button *button)
{
if (button->action.type != RATBAG_BUTTON_ACTION_TYPE_SPECIAL)
return 0;
return RATBAG_BUTTON_ACTION_SPECIAL_INVALID;
return button->action.action.special;
}
@@ -981,6 +984,9 @@ ratbag_button_set_special(struct ratbag_button *button,
rc = button->profile->device->driver->write_button(button, &action);
if (rc == 0)
button->action = action;
return rc;
}
@@ -1017,6 +1023,9 @@ ratbag_button_set_key(struct ratbag_button *button,
action.action.key.key = key;
rc = button->profile->device->driver->write_button(button, &action);
if (rc == 0)
button->action = action;
return rc;
}
@@ -1032,6 +1041,9 @@ ratbag_button_disable(struct ratbag_button *button)
action.type = RATBAG_BUTTON_ACTION_TYPE_NONE;
rc = button->profile->device->driver->write_button(button, &action);
if (rc == 0)
button->action = action;
return rc;
}

View File

@@ -927,7 +927,7 @@ ratbag_resolution_is_default(const struct ratbag_resolution *resolution);
*
* @return A button context, or NULL if the button does not exist.
*
* @see ratbag_get_num_buttons
* @see ratbag_device_get_num_buttons
*/
struct ratbag_button*
ratbag_profile_get_button(struct ratbag_profile *profile, unsigned int index);

View File

@@ -1,6 +1,6 @@
/* in alphabetical order! */
LIBRATBAG_0.1.0 {
LIBRATBAG_0.2.0 {
global:
ratbag_create_context;
ratbag_button_disable;

View File

@@ -15,6 +15,7 @@ libshared_la_LIBADD = $(LIBUDEV_CFLAGS) $(LIBEVDEV_LIBS)
ratbag_command_SOURCES = ratbag-command.c
ratbag_command_LDADD = ../src/libratbag.la libshared.la $(LIBUDEV_LIBS) $(LIBEVDEV_LIBS)
ratbag_command_CFLAGS = $(LIBUDEV_CFLAGS) $(LIBEVDEV_CFLAGS)
dist_man1_MANS = ratbag-command.man
hidpp10_dump_page_SOURCES = hidpp10-dump-page.c
hidpp10_dump_page_LDADD = ../src/libhidpp.la
@@ -28,5 +29,4 @@ hidpp20_dump_page_CFLAGS = -I$(top_srcdir)/src
lur_command_SOURCeS = lur-command.c
lur_command_LDADD = ../src/liblur.la
lur_command_LDFLAGS = -no-install
lur_command_CFLAGS = -I$(top_srcdir)/src

141
tools/ratbag-command.man Normal file
View File

@@ -0,0 +1,141 @@
.TH RATBAG_COMMAND "1"
.SH NAME
ratbag-command \- Query or change a device's settings
.SH SYNOPSIS
.B ratbag-command [OPTIONS] {COMMAND} ... /path/to/device
.SH DESCRIPTION
.PP
The
.I ratbag-commandq
tool query or change a device's settings.
.PP
This tool usually needs to be run as root to have access to the
/dev/input/eventX nodes.
.SH OPTIONS
.TP 8
.B --verbose
Print debugging output
.TP 8
.B --verbose=raw
Print debugging output with protocol output. No guarantees are given regarding
the output format when this flag is on.
.TP 8
.B --help
Print the help.
.SH General Commands
.TP 8
.B list
List supported devices (does not take a device argument)
.SH Device Commands
.TP 8
.B info
Print information about a device
.SH Profile Commands
.TP 8
.B profile active get
Print the currently active profile
.TP 8
.B profile active set N
Set profile N as to the active profile
.TP 8
.B profile N {COMMAND}
Use profile N for COMMAND
.SH Resolution Commands
Resolution commands work on the given profile, or on the active profile if none
is given.
.TP 8
.B resolution active get
Print the currently active resolution
.TP 8
.B resolution active set N
Set resolution N as the active resolution
.TP 8
.B resolution N {COMMAND}
Use resolution N for COMMAND
.SH DPI Commands
DPI commands work on the given profile and resolution, or on the active
resolution of the active profile if none are given.
.TP 8
.B dpi get
Print the dpi value
.TP 8
.B dpi set N
Set the dpi value to N
.TP 8
.B rate get
Print the report rate in Hz
.TP 8
.B rate set N
Set the report rate in N Hz
.SH Button Commands
Button commands work on the given profile, or on the active profile if none is
given.
.TP 8
.B button count
Print the number of buttons
.TP 8
.B button N action get
Print the button action
.TP 8
.B button N action set button B
Set the button action to button B
.TP 8
.B button N action set special S
Set the button action to special action S
.TP 8
.B button N action set macro ...
Set the button action to the given macro
.PP
.B Macro syntax:
.HP 8
A macro is a series of key events or waiting periods. Keys must be specified
in linux/input.h key names.
.RS
.TP 8
.B KEY_A
Press and release 'a'
.TP 8
.B +KEY_A
Press 'a'
.TP 8
.B -KEY_A
Release 'a'
.TP 8
.B t300
Wait 300ms
.RE
.SH Special Commands
These commands are for testing purposes and may be removed without notice
.TP 8
.B switch-etekcity
Switch the Etekcity mouse active profile
.SH Examples
.TP 8
ratbag-command profile active get
.TP 8
ratbag-command profile 0 resolution active set 4
.TP 8
ratbag-command profile 0 resolution 1 dpi get
.TP 8
ratbag-command resolution 4 rate get
.TP 8
ratbag-command dpi set 800
.SH Exit codes
.TP 8
.B 0
Success
.TP 8
.B 1
Unsupported feature or index out of available range
.TP 8
.B 2
Commandline arguments are invalid
.TP 8
.B 3
Invalid device or a command failed on the device
.SH NOTES
.PP
There is currently no guarantees that the output format of
.B ratbag-command
will not change in the future. There should be some stability with the commands
mentioned in this man page, but do not expect it to stay the same.