Skip to content

Commit 1da723b

Browse files
committed
cleanup: Make Tox_Options a typedef.
In preparation for it becoming private in 0.3.0.
1 parent b148a2a commit 1da723b

File tree

1 file changed

+41
-40
lines changed

1 file changed

+41
-40
lines changed

toxcore/tox.h

Lines changed: 41 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ typedef struct Tox_System Tox_System;
536536
* members. The struct will become opaque (i.e. the definition will become
537537
* private) in v0.3.0.
538538
*/
539+
typedef struct Tox_Options Tox_Options;
539540
struct Tox_Options {
540541

541542
/**
@@ -702,77 +703,77 @@ struct Tox_Options {
702703
};
703704

704705

705-
bool tox_options_get_ipv6_enabled(const struct Tox_Options *options);
706+
bool tox_options_get_ipv6_enabled(const Tox_Options *options);
706707

707-
void tox_options_set_ipv6_enabled(struct Tox_Options *options, bool ipv6_enabled);
708+
void tox_options_set_ipv6_enabled(Tox_Options *options, bool ipv6_enabled);
708709

709-
bool tox_options_get_udp_enabled(const struct Tox_Options *options);
710+
bool tox_options_get_udp_enabled(const Tox_Options *options);
710711

711-
void tox_options_set_udp_enabled(struct Tox_Options *options, bool udp_enabled);
712+
void tox_options_set_udp_enabled(Tox_Options *options, bool udp_enabled);
712713

713-
bool tox_options_get_local_discovery_enabled(const struct Tox_Options *options);
714+
bool tox_options_get_local_discovery_enabled(const Tox_Options *options);
714715

715-
void tox_options_set_local_discovery_enabled(struct Tox_Options *options, bool local_discovery_enabled);
716+
void tox_options_set_local_discovery_enabled(Tox_Options *options, bool local_discovery_enabled);
716717

717-
bool tox_options_get_dht_announcements_enabled(const struct Tox_Options *options);
718+
bool tox_options_get_dht_announcements_enabled(const Tox_Options *options);
718719

719-
void tox_options_set_dht_announcements_enabled(struct Tox_Options *options, bool dht_announcements_enabled);
720+
void tox_options_set_dht_announcements_enabled(Tox_Options *options, bool dht_announcements_enabled);
720721

721-
Tox_Proxy_Type tox_options_get_proxy_type(const struct Tox_Options *options);
722+
Tox_Proxy_Type tox_options_get_proxy_type(const Tox_Options *options);
722723

723-
void tox_options_set_proxy_type(struct Tox_Options *options, Tox_Proxy_Type proxy_type);
724+
void tox_options_set_proxy_type(Tox_Options *options, Tox_Proxy_Type proxy_type);
724725

725-
const char *tox_options_get_proxy_host(const struct Tox_Options *options);
726+
const char *tox_options_get_proxy_host(const Tox_Options *options);
726727

727-
void tox_options_set_proxy_host(struct Tox_Options *options, const char *proxy_host);
728+
void tox_options_set_proxy_host(Tox_Options *options, const char *proxy_host);
728729

729-
uint16_t tox_options_get_proxy_port(const struct Tox_Options *options);
730+
uint16_t tox_options_get_proxy_port(const Tox_Options *options);
730731

731-
void tox_options_set_proxy_port(struct Tox_Options *options, uint16_t proxy_port);
732+
void tox_options_set_proxy_port(Tox_Options *options, uint16_t proxy_port);
732733

733-
uint16_t tox_options_get_start_port(const struct Tox_Options *options);
734+
uint16_t tox_options_get_start_port(const Tox_Options *options);
734735

735-
void tox_options_set_start_port(struct Tox_Options *options, uint16_t start_port);
736+
void tox_options_set_start_port(Tox_Options *options, uint16_t start_port);
736737

737-
uint16_t tox_options_get_end_port(const struct Tox_Options *options);
738+
uint16_t tox_options_get_end_port(const Tox_Options *options);
738739

739-
void tox_options_set_end_port(struct Tox_Options *options, uint16_t end_port);
740+
void tox_options_set_end_port(Tox_Options *options, uint16_t end_port);
740741

741-
uint16_t tox_options_get_tcp_port(const struct Tox_Options *options);
742+
uint16_t tox_options_get_tcp_port(const Tox_Options *options);
742743

743-
void tox_options_set_tcp_port(struct Tox_Options *options, uint16_t tcp_port);
744+
void tox_options_set_tcp_port(Tox_Options *options, uint16_t tcp_port);
744745

745-
bool tox_options_get_hole_punching_enabled(const struct Tox_Options *options);
746+
bool tox_options_get_hole_punching_enabled(const Tox_Options *options);
746747

747-
void tox_options_set_hole_punching_enabled(struct Tox_Options *options, bool hole_punching_enabled);
748+
void tox_options_set_hole_punching_enabled(Tox_Options *options, bool hole_punching_enabled);
748749

749-
Tox_Savedata_Type tox_options_get_savedata_type(const struct Tox_Options *options);
750+
Tox_Savedata_Type tox_options_get_savedata_type(const Tox_Options *options);
750751

751-
void tox_options_set_savedata_type(struct Tox_Options *options, Tox_Savedata_Type savedata_type);
752+
void tox_options_set_savedata_type(Tox_Options *options, Tox_Savedata_Type savedata_type);
752753

753-
const uint8_t *tox_options_get_savedata_data(const struct Tox_Options *options);
754+
const uint8_t *tox_options_get_savedata_data(const Tox_Options *options);
754755

755-
void tox_options_set_savedata_data(struct Tox_Options *options, const uint8_t savedata_data[], size_t length);
756+
void tox_options_set_savedata_data(Tox_Options *options, const uint8_t savedata_data[], size_t length);
756757

757-
size_t tox_options_get_savedata_length(const struct Tox_Options *options);
758+
size_t tox_options_get_savedata_length(const Tox_Options *options);
758759

759-
void tox_options_set_savedata_length(struct Tox_Options *options, size_t savedata_length);
760+
void tox_options_set_savedata_length(Tox_Options *options, size_t savedata_length);
760761

761-
tox_log_cb *tox_options_get_log_callback(const struct Tox_Options *options);
762+
tox_log_cb *tox_options_get_log_callback(const Tox_Options *options);
762763

763-
void tox_options_set_log_callback(struct Tox_Options *options, tox_log_cb *log_callback);
764+
void tox_options_set_log_callback(Tox_Options *options, tox_log_cb *log_callback);
764765

765-
void *tox_options_get_log_user_data(const struct Tox_Options *options);
766+
void *tox_options_get_log_user_data(const Tox_Options *options);
766767

767-
void tox_options_set_log_user_data(struct Tox_Options *options, void *log_user_data);
768+
void tox_options_set_log_user_data(Tox_Options *options, void *log_user_data);
768769

769-
bool tox_options_get_experimental_thread_safety(const struct Tox_Options *options);
770+
bool tox_options_get_experimental_thread_safety(const Tox_Options *options);
770771

771-
void tox_options_set_experimental_thread_safety(struct Tox_Options *options, bool experimental_thread_safety);
772+
void tox_options_set_experimental_thread_safety(Tox_Options *options, bool experimental_thread_safety);
772773

773-
const Tox_System *tox_options_get_operating_system(const struct Tox_Options *options);
774+
const Tox_System *tox_options_get_operating_system(const Tox_Options *options);
774775

775-
void tox_options_set_operating_system(struct Tox_Options *options, const Tox_System *operating_system);
776+
void tox_options_set_operating_system(Tox_Options *options, const Tox_System *operating_system);
776777

777778
/**
778779
* @brief Initialises a Tox_Options object with the default options.
@@ -785,7 +786,7 @@ void tox_options_set_operating_system(struct Tox_Options *options, const Tox_Sys
785786
*
786787
* @param options An options object to be filled with default options.
787788
*/
788-
void tox_options_default(struct Tox_Options *options);
789+
void tox_options_default(Tox_Options *options);
789790

790791
typedef enum Tox_Err_Options_New {
791792

@@ -816,15 +817,15 @@ const char *tox_err_options_new_to_string(Tox_Err_Options_New value);
816817
*
817818
* @return A new Tox_Options object with default options or NULL on failure.
818819
*/
819-
struct Tox_Options *tox_options_new(Tox_Err_Options_New *error);
820+
Tox_Options *tox_options_new(Tox_Err_Options_New *error);
820821

821822
/**
822823
* @brief Releases all resources associated with an options objects.
823824
*
824825
* Passing a pointer that was not returned by tox_options_new results in
825826
* undefined behaviour.
826827
*/
827-
void tox_options_free(struct Tox_Options *options);
828+
void tox_options_free(Tox_Options *options);
828829

829830
/** @} */
830831

@@ -911,7 +912,7 @@ const char *tox_err_new_to_string(Tox_Err_New value);
911912
*
912913
* @return A new Tox instance pointer on success or NULL on failure.
913914
*/
914-
Tox *tox_new(const struct Tox_Options *options, Tox_Err_New *error);
915+
Tox *tox_new(const Tox_Options *options, Tox_Err_New *error);
915916

916917
/**
917918
* @brief Releases all resources associated with the Tox instance and

0 commit comments

Comments
 (0)