Skip to content

Tox_Options.operating_system is not clear about it being an experimental option #2739

@nurupo

Description

@nurupo

There is an experimental section at the bottom of Tox_Options:

c-toxcore/toxcore/tox.h

Lines 662 to 692 in ad4921d

/**
* These options are experimental, so avoid writing code that depends on
* them. Options marked "experimental" may change their behaviour or go away
* entirely in the future, or may be renamed to something non-experimental
* if they become part of the supported API.
*/
/**
* Make public API functions thread-safe using a per-instance lock.
*
* Default: false.
*/
bool experimental_thread_safety;
/**
* Low level operating system functionality such as send/recv, random
* number generation, and memory allocation.
*/
const Tox_System *operating_system;
/**
* Enable saving DHT-based group chats to Tox save data (via `tox_get_savedata`).
* This format will change in the future, so don't rely on it.
*
* As an alternative, clients can save the group chat ID in client-owned
* savedata. Then, when the client starts, it can use `tox_group_join`
* with the saved chat ID to recreate the group chat.
*
* Default: false.
*/
bool experimental_groups_persistence;
};

It starts with a comment that says:

  1. The following options are experimental
  2. Options marked "experimental" may change behavior or get removed
  3. Options marked "experimental" may be renamed to something non-experimental if they become part of the supported API

This sounds like all the options below that comment must be marked as "experimental" since they are all experimental.

Below we see experimental_groups_persistence and experimental_thread_safety, so by "marked experimental" I assume it means having the experimental_ prefix.

However, the operating_systems option is not prefixed with experimental_. Its naming goes against what the comment says -- that all options below the comment are experimental and thus are marked as experimental.

Due to (3), one might think that perhaps it was experimental at some point but has became a part of the supported API since it's not marked as experimental and someone just forgot to move it above the experimental section of Tox_Options. But apparently it is in fact an experimental option #2735 (comment).

So I'm left very confused as what is going on with the experimental section. It's not coherent and contradicts itself. Something needs to be done to clear this up before the .19 release as this might be API breaking change depending on how it's handled, e.g. if we end up renaming operating_systems to experimental_operating_systems, along with the get/set functions.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions