profile
viewpoint
Andrew Chin eminence Providence, RI

eminence/lifx 6

LIFX LAN network protocol in rust

eminence/libgit2-rs 4

rust bindings for libgit2

eminence/dotkeeper 2

Use git to version and control your config files, especially dot-files in your home directory

eminence/deduprs 1

Hardlink deduplication tool for Linux

eminence/django-cannen 1

a collaborative music player based on django and MPD

eminence/hesperus 1

a python bot framework, used (for now) as a github IRC bot

eminence/libredstone 1

a C library for all things Minecraft

eminence/async-std 0

Async version of the Rust standard library

eminence/basic-http-server 0

A static file server in Rust

delete branch eminence/procfs

delete branch : meminfo

delete time in 19 hours

delete branch eminence/procfs

delete branch : covtests

delete time in 19 hours

delete branch eminence/procfs

delete branch : fixes

delete time in 19 hours

delete branch eminence/procfs

delete branch : cputime_change

delete time in 19 hours

delete branch eminence/procfs

delete branch : deprecated

delete time in 19 hours

CommitCommentEvent

PR opened eminence/procfs

Handle locks that are marked as "blocked"

Closes #108

+35 -1

0 comment

1 changed file

pr created time in 20 hours

create barncheminence/procfs

branch : locks

created branch time in 20 hours

push eventeminence/procfs

Andrew Chin

commit sha 1c3cf5b407befce0230195ea10f699812a38a2b1

Remove deprecated functions

view details

Andrew Chin

commit sha 04548e1a447ced21465680883104c632f0819c65

Merge pull request #107 from eminence/deprecated Remove deprecated functions

view details

push time in a day

PR merged eminence/procfs

Remove deprecated functions

Closes #52 CC #69

+0 -24

0 comment

2 changed files

eminence

pr closed time in a day

issue closedeminence/procfs

more consistent function naming style

There are some naming inconsistencies that have been bothering me for a while, and I'd like to solicit input for anyone who has some. There is a mix of free functions that return structures, and constructor methods on structs. Some examples:

  • There's a free function process::all_processes() -> ProcResult<Vec<Process>> to get all processes, but a method Process::new(pid) -> ProcResult<Process> to get a single process
  • There's a free function cpuinfo() -> ProcResult<CpuInfo> to get CPU Info, but when getting memory info, you use a constructor method Meminfo::new() -> ProcResult<MemInfo>

My personal inclination is to remove the number of free functions (except when necessary, because there's no struct to attach to. boot_time_secs() -> ProcResult<u64> is a good example of this), but I'm curious to know if anyone else has any thoughts on this

closed time in a day

eminence

issue openedeminence/procfs

Failed to parse /proc/locks

The following /proc/locks file triggers an InternalError

1: POSIX  ADVISORY  WRITE 723 00:14:16845 0 EOF
2: FLOCK  ADVISORY  WRITE 652 00:14:16763 0 EOF
3: FLOCK  ADVISORY  WRITE 1594 fd:00:396528 0 EOF
4: FLOCK  ADVISORY  WRITE 1594 fd:00:396527 0 EOF
5: FLOCK  ADVISORY  WRITE 2851 fd:00:529372 0 EOF
6: POSIX  ADVISORY  WRITE 1280 00:14:16200 0 0
6: -> POSIX  ADVISORY  WRITE 1281 00:14:16200 0 0
6: -> POSIX  ADVISORY  WRITE 1279 00:14:16200 0 0
6: -> POSIX  ADVISORY  WRITE 1282 00:14:16200 0 0
6: -> POSIX  ADVISORY  WRITE 1283 00:14:16200 0 0
7: OFDLCK ADVISORY  READ  -1 00:06:1028 0 EOF
8: FLOCK  ADVISORY  WRITE 6471 fd:00:529426 0 EOF
9: FLOCK  ADVISORY  WRITE 6471 fd:00:529424 0 EOF
10: FLOCK  ADVISORY  WRITE 6471 fd:00:529420 0 EOF
11: FLOCK  ADVISORY  WRITE 6471 fd:00:529418 0 EOF
12: POSIX  ADVISORY  WRITE 1279 00:14:23553 0 EOF
13: FLOCK  ADVISORY  WRITE 6471 fd:00:393838 0 EOF
14: POSIX  ADVISORY  WRITE 655 00:14:16146 0 EOF

Running 4.19.0-6-amd64

created time in a day

PR opened eminence/procfs

Remove deprecated functions

Closes #52 CC #69

+0 -24

0 comment

2 changed files

pr created time in a day

create barncheminence/procfs

branch : deprecated

created branch time in a day

push eventeminence/procfs

Andrew Chin

commit sha bcc8d952cc267716e27ab1154895d786589c16e9

Store cputime in ticks, not fractional seconds Closes #76 CC #69

view details

Andrew Chin

commit sha 248a1a7da73c9814893214f52f6009288ad4c67b

Merge pull request #106 from eminence/cputime_change Store cputime in ticks, not fractional seconds

view details

push time in a day

PR merged eminence/procfs

Store cputime in ticks, not fractional seconds

Closes #76 CC #69

+174 -60

0 comment

1 changed file

eminence

pr closed time in a day

issue closedeminence/procfs

Returning ticks in CpuTime

Hello, The time returned in procfs::CpuTime should be a number of ticks in u64 as it is for processes in procfs::process::Stat. It's better to be able to get the values as returned by the kernel.

Originally posted by @lparcq in https://github.com/eminence/procfs/issues/69#issuecomment-632280841

closed time in a day

eminence

PR opened eminence/procfs

Store cputime in ticks, not fractional seconds

Closes #76 CC #69

+174 -60

0 comment

1 changed file

pr created time in 2 days

create barncheminence/procfs

branch : cputime_change

created branch time in 2 days

push eventeminence/procfs

Ivan Babrou

commit sha f2c5bce8f5be214bf266ba90b030bd0a4ff76d5a

Introduce fd_count() in addition to fd() Prometheus crate uses `fd()` to return the number of open file descriptors. Currently it takes 500ms to count 80k open files in an uncontended case, with this method we can cut this down to just 100ms by not resolving details of every open file descriptor.

view details

Andrew Chin

commit sha 028947aed8ca5183c026a3d72d6ca334f67b13f4

Merge pull request #105 from bobrik/ivan/fd-count Introduce fd_count() in addition to fd()

view details

push time in 2 days

PR merged eminence/procfs

Introduce fd_count() in addition to fd()

Prometheus crate uses fd() to return the number of open file descriptors. Currently it takes 500ms to count 80k open files in an uncontended case, with this method we can cut this down to just 100ms by not resolving details of every open file descriptor.

See: https://github.com/tikv/rust-prometheus/blob/512e8ed44c0fbbcef/src/process_collector.rs#L134-L137

+7 -0

1 comment

1 changed file

bobrik

pr closed time in 2 days

pull request commenteminence/procfs

Introduce fd_count() in addition to fd()

I like it, thanks!

bobrik

comment created time in 2 days

startedAScustomWorks/AS

started time in 5 days

push eventeminence/lifx

James Lee

commit sha dcca27ecf6fcfa5fe8d7c45954411317fa80f1ad

Fixup warnings+clippy lints, and run rustfmt

view details

James Lee

commit sha 33c46163b37ddc1053e361bfbac6bddcab433f8d

Set edition to 2018, remove `extern crate`s

view details

James Lee

commit sha d69bb4a672a7413fdf21311e8091630a21d9ca0d

Cleanup imports

view details

James Lee

commit sha 459efa5c3d907f37a0f2599e5b8c02eae949f05a

Replace `LifxFrom` with std `TryFrom`

view details

James Lee

commit sha 11863c64bc147d02b282368e18f7d37c530fb7b9

Split out worker thread to functions

view details

James Lee

commit sha 5a55793de721bfd68e32eca83c2f3328b8c38951

Set a source for all messags to avoid broadcasts

view details

James Lee

commit sha 6a85706a3c6759aca5126cfc5f22ff2be22839a4

Implement Debug for BulbInfo

view details

James Lee

commit sha cbc948267c7831f74e25cfb39d2e62a0e77e2d55

Cleanup message handling code in get_all_info

view details

James Lee

commit sha 2591cfb0a99f1047709ef8621baa936ec0a05c2f

Update dependencies with `cargo update`

view details

Andrew Chin

commit sha 47689f542433af8f2c9b387bdd735247ae26f2c9

Merge pull request #1 from jbit/cleanups Non-breaking code cleanups/upgrades

view details

push time in 8 days

PR merged eminence/lifx

Non-breaking code cleanups/upgrades

Hi!

I started doing some work on this crate with a view of making it a bit nicer to work with.

This PR just cleans up the code a little (with rustfmt/clippy's help), upgrades the dependencies, moves to Rust 2018, and makes the get_all_info sample a bit less verbose.

It shouldn't cause any API breakage, and the behaviour of the library should remain the same.

My idea going forward is to clean-up and extend the get_all_info sample, as it might help decide on an approach for the higher-level lifx crate, and if not, provide a good starting point for users of the lifx-core crate.

Cheers

--jbit

+418 -610

1 comment

11 changed files

jbit

pr closed time in 8 days

pull request commenteminence/lifx

Non-breaking code cleanups/upgrades

This is great, thank you for all these improvements!

jbit

comment created time in 8 days

Pull request review commenteminence/lifx

Non-breaking code cleanups/upgrades

 impl std::convert::From<io::Error> for Error {     } } +impl From<std::convert::Infallible> for Error {+    fn from(_: std::convert::Infallible) -> Self {+        unreachable!()+    }+}+ impl fmt::Display for Error {     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {         write!(f, "An error occurred.")     } } -trait LifxFrom<T>: Sized {-    fn from(val: T) -> Result<Self, Error>;-}--macro_rules! derive_lifx_from {-{ $( $t:ty ),*} => {-    $(-        impl LifxFrom<$t> for $t {-            fn from(val: $t) -> Result<Self, Error> { Ok(val)}-        }-    )*--}-}--derive_lifx_from! {-    u8, u16, i16, u32, f32, u64, LifxIdent, LifxString, EchoPayload, HSBK-}--impl LifxFrom<u8> for ApplicationRequest {-    fn from(val: u8) -> Result<ApplicationRequest, Error> {+impl TryFrom<u8> for ApplicationRequest {

For fun, I looked at this history of this file. I introduced the LifxFrom trait back in August 2018, which is about 8 months before TryFrom was stabilized 😄 So this is a nice modernization!

jbit

comment created time in 8 days

PullRequestReviewEvent

issue commenteminence/udt-rs

Reason for not inclusing "sendfile" in api?

HI! I don't think there is a good reason. I either missed this function when doing the initial implementation, or didn't have a need for it. It was a while ago, so I don't remember exactly :)

faldor20

comment created time in 10 days

fork eminence/rust-mumble-sys

Mumble client plugin API bindings for Rust

fork in 15 days

pull request commentmumble-voip/mumble

WIP: Plugin framework

Do plugins need to be thread safe? Will mumble ever call into the plugin callbacks simultaneously from different threads?

Krzmbrzl

comment created time in 15 days

push eventeminence/procfs

Andrew Chin

commit sha 2373215f552259f49b2e87dd66401fe1a3f0a2f8

Changes to tests to make them work in codespaces

view details

Andrew Chin

commit sha cd6c0c1f61e3b741b193ab8fe989c825c96934d1

Merge pull request #104 from eminence/fixes Changes to tests to make them work in codespaces

view details

push time in 16 days

PR merged eminence/procfs

Changes to tests to make them work in codespaces
+25 -12

0 comment

4 changed files

eminence

pr closed time in 16 days

PR opened eminence/procfs

Changes to tests to make them work in codespaces
+25 -12

0 comment

4 changed files

pr created time in 16 days

create barncheminence/procfs

branch : fixes

created branch time in 16 days

pull request commentmumble-voip/mumble

WIP: Plugin framework

When I first connect to a server, my plugin receives a mumble_onChannelEntered event (twice, actually), but calling API.getUserName on the provided userid returns EC_CONNECTION_UNSYNCHRONIZED -- is this expected that I would receive an event, but be unable to get details on the user/channel? Calling API.getUserName in subsequent events works fine, though.

Krzmbrzl

comment created time in 16 days

Pull request review commentmumble-voip/mumble

WIP: Plugin framework

+// Copyright 2019-2020 The Mumble Developers. All rights reserved.+// Use of this source code is governed by a BSD-style license+// that can be found in the LICENSE file at the root of the+// Mumble source tree or at <https://www.mumble.info/LICENSE>.++/// This header file specifies the Mumble plugin interface++#ifndef EXTERNAL_MUMBLE_PLUGIN_H_+#define EXTERNAL_MUMBLE_PLUGIN_H_++#include "PluginComponents_v_1_0_x.h"+#include "MumbleAPI_v_1_0_x.h"+#include <stdint.h>+#include <stddef.h>+#include <stdbool.h>++#if defined(__GNUC__) && !defined(__MINGW32__) // GCC on Unix-like systems+	#define PLUGIN_EXPORT __attribute__((visibility("default")))+#elif defined(_MSC_VER)+	#define PLUGIN_EXPORT __declspec(dllexport)+#elif defined(__MINGW32__)+	#define PLUGIN_EXPORT __attribute__((dllexport))+#else+	#error No PLUGIN_EXPORT definition available+#endif++// API version+#define MUMBLE_PLUGIN_API_MAJOR_PREPR 1+#define MUMBLE_PLUGIN_API_MINOR_PREPR 0+#define MUMBLE_PLUGIN_API_PATCH_PREPR 0++const int32_t MUMBLE_PLUGIN_API_MAJOR = MUMBLE_PLUGIN_API_MAJOR_PREPR;+const int32_t MUMBLE_PLUGIN_API_MINOR = MUMBLE_PLUGIN_API_MINOR_PREPR;+const int32_t MUMBLE_PLUGIN_API_PATCH = MUMBLE_PLUGIN_API_PATCH_PREPR;+const mumble_version_t MUMBLE_PLUGIN_API_VERSION = { MUMBLE_PLUGIN_API_MAJOR, MUMBLE_PLUGIN_API_MINOR, MUMBLE_PLUGIN_API_PATCH };++// Create macro for casting the pointer to the API object to the proper struct.+// Note that this must only be used if the API uses MUMBLE_PLUGIN_API_VERSION of the API.+#define MUMBLE_CONCAT_HELPER(a, b) a ## _ ## b+#define MUMBLE_CONCAT(a, b) MUMBLE_CONCAT_HELPER(a, b)+#define MUMBLE_API_STRUCT MUMBLE_CONCAT(MumbleAPI_v, MUMBLE_CONCAT(MUMBLE_PLUGIN_API_MAJOR_PREPR, MUMBLE_CONCAT(MUMBLE_PLUGIN_API_MINOR_PREPR, x)))+#define MUMBLE_API_CAST(ptrName) ( *((struct MUMBLE_API_STRUCT *) ptrName) )++#ifdef __cplusplus+extern "C" {+#endif++	//////////////////////////////////////////////////////////////////////////////////+	////////////////////////////// MANDATORY FUNCTIONS ///////////////////////////////+	//////////////////////////////////////////////////////////////////////////////////+	+	/// Gets called right after loading the plugin in order to let the plugin initialize.+	///+	/// Registers the ID of this plugin.+	/// @param id The ID for this plugin. This is the ID Mumble will reference this plugin with+	/// 	and by which this plugin can identify itself when communicating with Mumble.+	/// @returns The status of the initialization. If everything went fine, return STATUS_OK+	PLUGIN_EXPORT mumble_error_t PLUGIN_CALLING_CONVENTION mumble_init(uint32_t id);+	+	/// Gets called when unloading the plugin in order to allow it to clean up after itself.+	PLUGIN_EXPORT void PLUGIN_CALLING_CONVENTION mumble_shutdown();

When mumble_shutdown is called, is it still safe to call the plugin API functions? It would be good to document the answer in these comments.

Krzmbrzl

comment created time in 16 days

PullRequestReviewEvent

Pull request review commentmumble-voip/mumble

WIP: Plugin framework

+// Copyright 2019-2020 The Mumble Developers. All rights reserved.+// Use of this source code is governed by a BSD-style license+// that can be found in the LICENSE file at the root of the+// Mumble source tree or at <https://www.mumble.info/LICENSE>.++/// This header file contains definitions of types and other components used in Mumble's plugin system++#ifndef MUMBLE_PLUGINCOMPONENT_H_+#define MUMBLE_PLUGINCOMPONENT_H_++#include <stdint.h>+#include <stddef.h>+#include <stdbool.h>++#ifdef __cplusplus+#	include <string>+#endif++#ifdef QT_VERSION+	#include <QString>+#endif++// define the calling convention macro based on the compiler being used+#if defined(_MSC_VER)+	#define PLUGIN_CALLING_CONVENTION __cdecl+#elif defined(__MINGW32__)+	#define PLUGIN_CALLING_CONVENTION __attribute__((cdecl))+#else+	#define PLUGIN_CALLING_CONVENTION+#endif+++/// A macro holding the exit status of a successful operation+#define STATUS_OK EC_OK+/// A macro holding the version object that is considered to correspond to an unknown version+#define VERSION_UNKNOWN Version({0,0,0})+++/// This enum's values correspond to special feature sets a plugin may provide.+/// They are meant to be or'ed together to represent the total feature set of a plugin.+enum Mumble_PluginFeature {+	/// None of the below+	FEATURE_NONE = 0,+	/// The plugin provides positional data from a game+	FEATURE_POSITIONAL = 1 << 0,+	/// The plugin modifies the input/output audio itself+	FEATURE_AUDIO = 1 << 1+};++/// This enum's values represent talking states a user can be in when using Mumble.+enum Mumble_TalkingState {+	INVALID=-1,+	PASSIVE=0,+	TALKING,+	WHISPERING,+	SHOUTING+};++/// This enum's values represent transmission modes a user might have configured. Transmission mode+/// in this context is referring to a method that determines when a user is speaking and thus when+/// to transmit audio packets.+enum Mumble_TransmissionMode {+	TM_CONTINOUS,+	TM_VOICE_ACTIVATION,+	TM_PUSH_TO_TALK+};++/// This enum's values represent the error codes that are being used by the MumbleAPI.+/// You can get a string-representation for each error code via the errorMessage function.+enum Mumble_ErrorCode {+	EC_INTERNAL_ERROR = -2,+	EC_GENERIC_ERROR = -1,+	EC_OK = 0,+	EC_POINTER_NOT_FOUND,+	EC_NO_ACTIVE_CONNECTION,+	EC_USER_NOT_FOUND,+	EC_CHANNEL_NOT_FOUND,+	EC_CONNECTION_NOT_FOUND,+	EC_UNKNOWN_TRANSMISSION_MODE,+	EC_AUDIO_NOT_AVAILABLE,+	EC_INVALID_SAMPLE,+	EC_INVALID_PLUGIN_ID,+	EC_INVALID_MUTE_TARGET,+	EC_CONNECTION_UNSYNCHRONIZED,+	EC_INVALID_API_VERSION,+	EC_UNSYNCHRONIZED_BLOB,+	EC_UNKNOWN_SETTINGS_KEY,+	EC_WRONG_SETTINGS_TYPE,+	EC_SETTING_WAS_REMOVED+};++/// This enum's values represent error codes specific to the framework of handling positional data+/// gathering (needed for Mumble's positional audio feature).+enum Mumble_PositionalDataErrorCode {+	/// Positional data has been initialized properly+	PDEC_OK = 0,+	/// Positional data is temporarily unavailable (e.g. because the corresponding process isn't running) but might be+	/// at another point in time.+	PDEC_ERROR_TEMP,+	/// Positional data is permanently unavailable (e.g. because the respective memory offsets are outdated).+	PDEC_ERROR_PERM+};++/// This enum's values represent keys for specific settings inside Mumble.+enum Mumble_SettingsKey {+	MSK_INVALID = -1,+	MSK_AUDIO_INPUT_VOICE_HOLD = 0,+	MSK_AUDIO_INPUT_VAD_SILENCE_THRESHOLD = 1,+	MSK_AUDIO_INPUT_VAD_SPEECH_THRESHOLD = 2,+};++/// This enum's values represent the key-codes Mumble's API uses to reference keys on the keyboard.+enum Mumble_KeyCode {+	KC_INVALID           = -1,++	// Non-printable characters first+	KC_NULL              = 0,+	KC_END               = 1,+	KC_LEFT              = 2,+	KC_RIGHT             = 4,+	KC_UP                = 5,+	KC_DOWN              = 6,+	KC_DELETE            = 7,+	KC_BACKSPACE         = 8,+	KC_TAB               = 9,+	KC_ENTER             = 10, // == '\n'+	KC_ESCAPE            = 27,+	KC_PAGE_UP           = 11,+	KC_PAGE_DOWN         = 12,+	KC_SHIFT             = 13,+	KC_CONTROL           = 14,+	KC_META              = 15,+	KC_ALT               = 16,+	KC_ALT_GR            = 17,+	KC_CAPSLOCK          = 18,+	KC_NUMLOCK           = 19,+	KC_SUPER             = 20, // == windows key+	KC_HOME              = 21, // == Pos1+	KC_PRINT             = 22,+	KC_SCROLLLOCK        = 23,++	// Printable characters are assigned to their ASCII code+	KC_SPACE             = ' ',+	KC_EXCLAMATION_MARK  = '!',+	KC_DOUBLE_QUOTE      = '"',+	KC_HASHTAG           = '#',+	KC_DOLLAR            = '$',+	KC_PERCENT           = '%',+	KC_AMPERSAND         = '&',+	KC_SINGLE_QUOTE      = '\'',+	KC_OPEN_PARENTHESIS  = '(',+	KC_CLOSE_PARENTHESIS = ')',+	KC_ASTERISK          = '*',+	KC_PLUS              = '+',+	KC_COMMA             = ',',+	KC_MINUS             = '-',+	KC_PERIOD            = '.',+	KC_SLASH             = '/',+	KC_0                 = '0',+	KC_1                 = '1',+	KC_2                 = '2',+	KC_3                 = '3',+	KC_4                 = '4',+	KC_5                 = '5',+	KC_6                 = '6',+	KC_7                 = '7',+	KC_8                 = '8',+	KC_9                 = '9',+	KC_COLON             = ':',+	KC_SEMICOLON         = ';',+	KC_LESS_THAN         = '<',+	KC_EQUALS            = '=',+	KC_GREATER_THAN      = '>',+	KC_QUESTION_MARK     = '?',+	KC_AT_SYMBOL         = '@',+	KC_A                 = 'A',+	KC_B                 = 'B',+	KC_C                 = 'C',+	KC_D                 = 'D',+	KC_E                 = 'E',+	KC_F                 = 'F',+	KC_G                 = 'G',+	KC_H                 = 'H',+	KC_I                 = 'I',+	KC_J                 = 'J',+	KC_K                 = 'K',+	KC_L                 = 'L',+	KC_M                 = 'M',+	KC_N                 = 'N',+	KC_O                 = 'O',+	KC_P                 = 'P',+	KC_Q                 = 'Q',+	KC_R                 = 'R',+	KC_S                 = 'S',+	KC_T                 = 'T',+	KC_U                 = 'U',+	KC_V                 = 'V',+	KC_W                 = 'W',+	KC_X                 = 'X',+	KC_Y                 = 'Y',+	KC_Z                 = 'Z',+	// leave out lowercase letters (for now)+	KC_OPEN_BRACKET      = '[',+	KC_BACKSLASH         = '\\',+	KC_CLOSE_BRACKET     = ']',+	KC_CIRCUMFLEX        = '^',+	KC_UNDERSCORE        = '_',+	KC_GRAVE_AKCENT      = '`',+	KC_OPEN_BRACE        = '{',+	KC_VERTICAL_BAR      = '|',+	KC_CLOSE_BRACE       = '}',+	KC_TILDE             = '~',++	// Some characters from the extended ASCII code+	KC_DEGREE_SIGN       = 176,++++	// F-keys+	// Start at a value of 256 as extended ASCII codes range up to 256+	KC_F1                = 256,+	KC_F2                = 257,+	KC_F3                = 258,+	KC_F4                = 259,+	KC_F5                = 260,+	KC_F6                = 261,+	KC_F7                = 262,+	KC_F8                = 263,+	KC_F9                = 264,+	KC_F10               = 265,+	KC_F11               = 266,+	KC_F12               = 267,+	KC_F13               = 268,+	KC_F14               = 269,+	KC_F15               = 270,+	KC_F16               = 271,+	KC_F17               = 272,+	KC_F18               = 273,+	KC_F19               = 274,+};++/// A struct for representing a version of the form major.minor.patch+struct Version {+	int32_t major;+	int32_t minor;+	int32_t patch;+#ifdef __cplusplus+	bool operator<(const Version& other) const {+		if (this->major != other.major) {+			return this->major < other.major;+		}+		if (this->minor != other.minor) {+			return this->minor < other.minor;+		}+		// Major and Minor are equal+		return this->patch < other.patch;+	}++	bool operator>(const Version& other) const {+		if (this->major != other.major) {+			return this->major > other.major;+		}+		if (this->minor != other.minor) {+			return this->minor > other.minor;+		}+		// Major and Minor are equal+		return this->patch > other.patch;+	}++	bool operator>=(const Version& other) const {+		if (this->major != other.major) {+			return this->major > other.major;+		}+		if (this->minor != other.minor) {+			return this->minor > other.minor;+		}+		// Major and Minor are equal+		return this->patch >= other.patch;+	}++	bool operator<=(const Version& other) const {+		if (this->major != other.major) {+			return this->major < other.major;+		}+		if (this->minor != other.minor) {+			return this->minor < other.minor;+		}+		// Major and Minor are equal+		return this->patch <= other.patch;+	}++	bool operator==(const Version& other) const {+		return this->major == other.major && this->minor == other.minor && this->patch == other.patch;+	}++	bool operator!=(const Version& other) const {+		return this->major != other.major || this->minor != other.minor || this->patch != other.patch;+	}++	operator std::string() const {+		return std::string("v") + std::to_string(this->major) + std::to_string(this->minor) + std::to_string(this->patch);+	}++#ifdef QT_VERSION+	operator QString() const {+		return QString::fromLatin1("v%0.%1.%2").arg(this->major).arg(this->minor).arg(this->patch);+	}+#endif+#endif+};++/// @param errorCode The error code to get a message for+/// @returns The error message coresponding to the given error code. The message+/// 	is encoded as a C-string and are static meaning that it is safe to use the+/// 	returned pointer in your code.+inline const char* errorMessage(int16_t errorCode) {+	switch (errorCode) {+		case EC_GENERIC_ERROR:+			return "Generic error";+		case EC_OK:+			return "Ok - this is not an error";+		case EC_POINTER_NOT_FOUND:+			return "Can't find the passed pointer";+		case EC_NO_ACTIVE_CONNECTION:+			return "There is currently no active connection to a server";+		case EC_USER_NOT_FOUND:+			return "Can't find the requested user";+		case EC_CHANNEL_NOT_FOUND:+			return "Can't find the requested channel";+		case EC_CONNECTION_NOT_FOUND:+			return "Can't identify the requested connection";+		case EC_UNKNOWN_TRANSMISSION_MODE:+			return "Unknown transmission mode encountered";+		case EC_AUDIO_NOT_AVAILABLE:+			return "There is currently no audio output available";+		case EC_INVALID_SAMPLE:+			return "Attempted to use invalid sample (can't play it)";+		case EC_INVALID_PLUGIN_ID:+			return "Used an invalid plugin ID";+		case EC_INVALID_MUTE_TARGET:+			return "Used an invalid mute-target";+		case EC_CONNECTION_UNSYNCHRONIZED:+			return "The requested server connection has not yet finished synchrnonizing";+		case EC_INVALID_API_VERSION:+			return "The used API version is invalid or not supported";+		case EC_UNSYNCHRONIZED_BLOB:+			return "The requested blob (content) has not yet been synchronized between the client and the server";+		case EC_UNKNOWN_SETTINGS_KEY:+			return "The used settings-key does not match any key known to Mumble";+		case EC_WRONG_SETTINGS_TYPE:+			return "The referenced setting has a different type than requested";+		case EC_SETTING_WAS_REMOVED:+			return "The referenced setting got removed from Mumble and is no longer used";+		default:+			return "Unknown error code";+	}+}+++struct MumbleStringWrapper {+	/// The pointer to the actual String data+	const char *data;

Does this string data need to end with a null byte?

Krzmbrzl

comment created time in 16 days

PullRequestReviewEvent

startedmumble-voip/mumble

started time in 16 days

starteddandavison/delta

started time in 17 days

push eventeminence/procfs

Arne Beer

commit sha b6e651c7ffd5859ad63a2335422a002e90585ec9

Clippy: Don't right shift u32 by 0

view details

Arne Beer

commit sha fcb78c0839b1c9a9e980a69f933293327fa28f28

Clippy: Codestyle cleanup in net.rs

view details

Arne Beer

commit sha 63bf3b4e516fccd3c17bf482b6545598f667d161

Clippy: Remove single character variables

view details

Arne Beer

commit sha c881d73b8a9f12bddab24a97b3f79fc60a35252c

Disable lint warnings for some deprecations

view details

Arne Beer

commit sha da555285f3965ee852fbb506ad2bcf5c5d2d30ae

Run cargo fmt

view details

Arne Beer

commit sha 649b805ac4b1d3e3b0bc0a1f9a82c97f7749d59a

Clippy: Allow unknown lints for legacy versions

view details

Andrew Chin

commit sha 18ff26ba2229fa23c4a3e48f605b4066df210b6b

Merge pull request #98 from Nukesor/fix-clippy-issues Fix clippy and rustfmt issues

view details

push time in 19 days

PR merged eminence/procfs

Fix clippy and rustfmt issues

I just took the opportunity and started to hack around a little :)

This PR is build upon the other cargo fmt branch.

This probably needs some discussion as mentioned in issue #69. There are two strip_prefix commits, which replace manual string prefix removal by the newly added strip_prefix method and one commit which renames the deprecated intra_doc_link_resolution_failure.

Since the latest feature has only just been added in Rust 1.45, this will drop support for rust 1.38 and 1.33. I'm not sure what your policy for support of old rust versions is. In case you don't want to drop support for these versions, I would disable all clippy rules for all breaking changes and reintroduce these targets to the CI rules.

Anyway, I hope you would like to see clippy being added to this project's CI

+49 -23

5 comments

3 changed files

Nukesor

pr closed time in 19 days

pull request commenteminence/procfs

Fix clippy and rustfmt issues

Thank you!

Nukesor

comment created time in 19 days

delete branch eminence/rust-analyzer.github.io

delete branch : prfix

delete time in 19 days

create barncheminence/rust-analyzer.github.io

branch : prfix

created branch time in 19 days

pull request commenteminence/procfs

Swap libflate for flate2

Hmm, this is a tough call! I told @Nukesor in #98 that I didn't want to change the MSRV to 1.45 (2020-07-16) for an internal implementation detail. But to be honest, I don't really have a well-thought-out policy on this.

1.34 is still fairly old (2019-04-11), and if accepted, this change would be in an upcoming 0.9.0 release (where we'd be able to bump the MSRV).

Regarding switching to flate2, I took a look at a bunch of crates that depend on procfs (what I could find by searching github). Most of them didn't have any other flate-related dependencies, but indeed there were a few that had flate2 brought into the dep-tree (thus if procfs switched to flate2, it would be a few less dependencies for upstream crates). Also, flate2 seems to be a tiny bit smaller, which is good too.

So I'm probably inclined to accept this, but I welcome thought (from anyone reading this issue) on the MSRV topic

benesch

comment created time in 20 days

pull request commenteminence/procfs

Fix clippy and rustfmt issues

This is minor, but since we're in this part of the code..... What do you think about adding/allowing clippy::unknown_clippy_lints to quell this warning:

warning: unknown clippy lint: clippy::manual_strip
 --> src/net.rs:3:10
  |
3 | #![allow(clippy::manual_strip)]
  |          ^^^^^^^^^^^^^^^^^^^^ help: did you mean: `clippy::manual_swap`
  |
  = note: `#[warn(clippy::unknown_clippy_lints)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unknown_clippy_lints

Nukesor

comment created time in 20 days

PullRequestReviewEvent

Pull request review commenteminence/procfs

Fix clippy and rustfmt issues

 pub fn ticks_per_second() -> std::io::Result<i64> {     if cfg!(unix) {         match unsafe { sysconf(_SC_CLK_TCK) } {             -1 => Err(std::io::Error::last_os_error()),-            x => Ok(x.into()),+            x => Ok(x),

Can you leave this as x.into()? Removing this will break the build on 32-bit, since on 32-bit linux, sysconf returns an i32. So the .x.into() will widen this to an i64. Same comment applies below to line 671.

Nukesor

comment created time in 21 days

Pull request review commenteminence/procfs

Fix clippy and rustfmt issues

 pub fn enabled() -> ProcResult<bool> {     Ok(val == "enabled") } -struct BinFmtEntry {

I know this struct is private and unused, but it'll soon be exposed. Can you leave it in?

Nukesor

comment created time in 21 days

PullRequestReviewEvent
PullRequestReviewEvent

push eventeminence/procfs

Andrew Chin

commit sha 230d21e4e1648286e068c4026aca2e0f0a139110

Tweaks to tests to make them more stable under codecoverage

view details

Andrew Chin

commit sha d9800ea500e3b43deba43011ad42b22da7defcb6

Additional tests to boost code coverage

view details

Andrew Chin

commit sha eaf10c60ab2ef37fe500d0257257c9910589c5b9

Merge pull request #99 from eminence/covtests Additional tests to boost code coverage

view details

push time in 21 days

PR merged eminence/procfs

Additional tests to boost code coverage

These new tests aren't very interesting, but boost coverage from about 76% to 83%

+93 -20

0 comment

7 changed files

eminence

pr closed time in 21 days

push eventeminence/procfs

Andrew Chin

commit sha 3f5462e54750c31fa5b052e0248ea6e6faafc54c

Add a private field to some large structs Adding a private field to these structs will prevent clients from directly constructing them. This will allow us to add new fields to them in a semver compatible way. This change itself is a semver incompatible change, though.

view details

Andrew Chin

commit sha 582ddab85decf7abca324c9b15b6ed54fd3e4b5c

Merge pull request #101 from eminence/structs Add a private field to some large structs

view details

Andrew Chin

commit sha 8bb00a1032bc3cf9ea2135192383784f2d432aed

Add two new fields to Meminfo struct These don't seem to be well documented in the kernel, I'm not sure what they're used for

view details

Andrew Chin

commit sha fb918c5bf3d7cd873f5122e2a6fd3234b71673fe

Merge pull request #103 from eminence/meminfo Add two new fields to Meminfo struct

view details

Andrew Chin

commit sha 230d21e4e1648286e068c4026aca2e0f0a139110

Tweaks to tests to make them more stable under codecoverage

view details

Andrew Chin

commit sha d9800ea500e3b43deba43011ad42b22da7defcb6

Additional tests to boost code coverage

view details

push time in 21 days

push eventeminence/procfs

Andrew Chin

commit sha 8bb00a1032bc3cf9ea2135192383784f2d432aed

Add two new fields to Meminfo struct These don't seem to be well documented in the kernel, I'm not sure what they're used for

view details

Andrew Chin

commit sha fb918c5bf3d7cd873f5122e2a6fd3234b71673fe

Merge pull request #103 from eminence/meminfo Add two new fields to Meminfo struct

view details

push time in 21 days

PR merged eminence/procfs

Add two new fields to Meminfo struct

These don't seem to be well documented in the kernel, I'm not sure what they're used for

Closes #102

+12 -0

0 comment

1 changed file

eminence

pr closed time in 21 days

issue closedeminence/procfs

`test_meminfo` fails on Kernel 5.8.12. Fields FileHugePages and FilePmdMapped

In this commit, two new fields have been added to /proc/meminfo: https://github.com/torvalds/linux/commit/60fbf0ab5da1c360e02b7f7d882bf1c0d8f7e32a

The fields are FileHugePages and FilePmdMapped.

From what it looks like the Change has been added in v5.4-rc1, since it pops up in the diff from v5.4 and v5.4-rc1.

However, I'm not exactly sure what their purpose is, since I'm not that deep into kernel development and the commit messages are pretty nondescript...

closed time in 21 days

Nukesor

issue commenteminence/procfs

`test_meminfo` fails on Kernel 5.8.12. Fields FileHugePages and FilePmdMapped

Yeah, I've also not been able to find much about these new fields. But I've added them to the MemInfo struct anyway

Nukesor

comment created time in 21 days

push eventeminence/procfs

Andrew Chin

commit sha 8bb00a1032bc3cf9ea2135192383784f2d432aed

Add two new fields to Meminfo struct These don't seem to be well documented in the kernel, I'm not sure what they're used for

view details

push time in 21 days

push eventeminence/procfs

Andrew Chin

commit sha 3cc141065c7fc5e20aeb29c1629f0f948a2ec5ea

Add two new fields to Meminfo struct These don't seem to be well documented in the kernel, I'm not sure what they're used for

view details

push time in 21 days

PR opened eminence/procfs

Add two new fields to Meminfo struct

These don't seem to be well documented in the kernel, I'm not sure what they're used for

Closes #102

+11 -0

0 comment

1 changed file

pr created time in 21 days

delete branch eminence/procfs

delete branch : structs

delete time in 21 days

create barncheminence/procfs

branch : meminfo

created branch time in 21 days

push eventeminence/procfs

Andrew Chin

commit sha 3f5462e54750c31fa5b052e0248ea6e6faafc54c

Add a private field to some large structs Adding a private field to these structs will prevent clients from directly constructing them. This will allow us to add new fields to them in a semver compatible way. This change itself is a semver incompatible change, though.

view details

Andrew Chin

commit sha 582ddab85decf7abca324c9b15b6ed54fd3e4b5c

Merge pull request #101 from eminence/structs Add a private field to some large structs

view details

push time in 21 days

PR merged eminence/procfs

Add a private field to some large structs

Adding a private field to these structs will prevent clients from directly constructing them. This will allow us to add new fields to them in a semver compatible way.

This change itself is a semver incompatible change, though. CC #69

+16 -0

0 comment

3 changed files

eminence

pr closed time in 21 days

pull request commenteminence/procfs

Add github action workflow check that enforces 'cargo fmt'

Thanks for researching this a bit. It's a bummer that github doesn't support this, though hopefully one day they will! Something like Gitlab's "allow_failure: true" would fit well here, I think.

So regarding these two pull requests, let's close them, since github actions can't really do what we want.

If you wanted to open another PR with some clippy/fmt fixes, I'd be happy to accept that :)

Nukesor

comment created time in 22 days

PR opened eminence/procfs

Add a private field to some large structs

Adding a private field to these structs will prevent clients from directly constructing them. This will allow us to add new fields to them in a semver compatible way.

This change itself is a semver incompatible change, though. CC #69

+16 -0

0 comment

3 changed files

pr created time in 22 days

create barncheminence/procfs

branch : structs

created branch time in 22 days

PR opened eminence/procfs

Additional tests to boost code coverage

These new tests aren't very interesting, but boost coverage from about 76% to 83%

+93 -20

0 comment

7 changed files

pr created time in 22 days

create barncheminence/procfs

branch : covtests

created branch time in 22 days

pull request commenteminence/procfs

Fix clippy issues

HI! Thanks for tackling the clippy issues. While code with strip_prefix is clearly much nicer, I'm not willing to drop support for 1.33 and 1.38

Nukesor

comment created time in 22 days

pull request commenteminence/procfs

Add github action workflow check that enforces 'cargo fmt'

Yeah, some of the tests are a little racey (a few milliseconds go by between when we get a process listing and when we try to get info about it -- in that time, the process might have exited). I've re-run the tests and they are passing now.

This same comment applies to both of your pull requests: I don't really have an objection to adding clippy or rustfmt to CI (as you'll see several commits in the git history were I apply clippy or fmt fixes), but I'm a little hesitant to block PRs on them. It's a bit of a barrier/annoyance that I'm OK dealing with myself, but I don't necessarily want all contributors to deal with it if they don't want to.

Can we try to mark the rustfmt and clippy jobs as "continue-on-error" (and then introduce a "fake" clippy or fmt error to see what it looks like)? I've not used this github action setting before, but I'm hoping it might be like gitlab's "allow-failure" where it turns the job a yellow color.

Nukesor

comment created time in 22 days

release eminence/procfs

v0.8.1

released time in 22 days

delete branch eminence/procfs

delete branch : deleteme

delete time in a month

delete branch eminence/procfs

delete branch : sysfs

delete time in a month

delete branch eminence/procfs

delete branch : fixes

delete time in a month

delete branch eminence/procfs

delete branch : fuzzfix

delete time in a month

delete branch eminence/procfs

delete branch : arp

delete time in a month

delete branch eminence/procfs

delete branch : tasks

delete time in a month

delete branch eminence/procfs

delete branch : rpi_cpuinfo

delete time in a month

delete branch eminence/procfs

delete branch : actions

delete time in a month

push eventeminence/procfs

Andrew Chin

commit sha a33d3a113d929747ffaa823a9932d7599d50d6af

Update and standardize on github actions for CI No more travis

view details

Andrew Chin

commit sha 9a6fa7a46142278d31c210040e20e99d0a265384

Tweak test threashold

view details

Andrew Chin

commit sha 800619b77a229e93058fe52c07201feb7ff95ca1

Merge pull request #96 from eminence/actions Fully switch to github actions for CI

view details

push time in a month

PR merged eminence/procfs

Fully switch to github actions for CI
+62 -31

0 comment

3 changed files

eminence

pr closed time in a month

PR opened eminence/procfs

Fully switch to github actions for CI
+62 -31

0 comment

3 changed files

pr created time in a month

push eventeminence/procfs

Andrew Chin

commit sha 9a6fa7a46142278d31c210040e20e99d0a265384

Tweak test threashold

view details

push time in a month

push eventeminence/procfs

Andrew Chin

commit sha a33d3a113d929747ffaa823a9932d7599d50d6af

Update and standardize on github actions for CI No more travis

view details

push time in a month

push eventeminence/procfs

Andrew Chin

commit sha e0e9f06500bf059f556ba864550b09dcbca2248f

Updated github actions

view details

push time in a month

push eventeminence/procfs

Andrew Chin

commit sha 7724af2a923db4e5c9023b1afa34153e6f856639

Updated github actions

view details

push time in a month

push eventeminence/procfs

Andrew Chin

commit sha 0be1027b21bc6b6f2bf6c6129cfe3799ae41cc52

Updated github actions

view details

push time in a month

push eventeminence/procfs

Andrew Chin

commit sha 4d7043d2edacc1571bfe4b21801c3c56bd0c7a8e

Updated github actions

view details

push time in a month

push eventeminence/procfs

Andrew Chin

commit sha 8b6144b5f0eb1aace9b97963dc9b9cd5735654fa

Updated github actions

view details

push time in a month

push eventeminence/procfs

Andrew Chin

commit sha 87ea747a625dc80f16f81ffde9fc8cee5db01c98

Updated github actions

view details

push time in a month

create barncheminence/procfs

branch : actions

created branch time in a month

push eventeminence/procfs

Fabrice Desré

commit sha 50d197dce099e66d3e70424fd815e6d8b14a36bd

Add Android support

view details

Andrew Chin

commit sha a616c554c9ba4d70d1bda463c10ee4fb64ab677f

Merge pull request #95 from fabricedesre/android Add Android support

view details

push time in a month

PR merged eminence/procfs

Add Android support

This adds support for android targets. Changes needed are:

  • use the android specific version of the MetadataExt trait.
  • use libc::mode_t instead of hardcoding the type for file modes (it's a u16 on 32bit Android targets).
+6 -4

3 comments

1 changed file

fabricedesre

pr closed time in a month

more