Big pass on API symbol namings for readability purpose (#180) #181
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
OragonEfreet/banjo!181
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "api-readability-conventions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Commit 3 of the API readability rework (docs/design/api-rename-plan.md). Old names keep working via src/deprecated.c; removed in 2.0. - bj_bind_window / bj_unbind_window -> bj_create_window / bj_destroy_window - bj_should_close_window -> bj_window_should_close - bj_get_window_flags(w, mask) -> bj_window_flags(w) + bj_window_has_flag(w, flag) - bj_get_key -> bj_window_is_key_pressed (now returns bj_bool; it only ever reported held / not-held) - bj_get_window_size -> bj_window_size - bj_set_draw_callback -> bj_set_window_draw_callback - bj_set_resize_callback -> bj_set_window_resize_callback - bj_set_window_fullscreen(w, enable) -> bj_window_enter_fullscreen(w) / bj_window_leave_fullscreen(w) - bj_is_window_fullscreen -> bj_window_is_fullscreen bj_set_window_should_close keeps its name (it is a command, not a set-to-value). Internal callers, all examples and the window tests move to the new names; test/deprecated_api.c gains a window group. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RMEMpDnGCSyhm2vxpWR5xtCommit 4 of the API readability rework (docs/design/api-rename-plan.md). - bj_poll_events -> bj_poll_event (one event per call; R13). Old name kept as a forwarder in src/deprecated.c, removed in 2.0. - enum bj_event_action: BJ_RELEASE / BJ_PRESS / BJ_REPEAT -> BJ_EVENT_ACTION_RELEASE / _PRESS / _REPEAT (R11). Short names kept as deprecated #defines. All five video backends migrated. - bj_push_enter_event: the bj_bool argument becomes enum bj_cursor_crossing { BJ_CURSOR_CROSSING_LEAVE = 0, BJ_CURSOR_CROSSING_ENTER = 1 } (R9). Values match BJ_FALSE / BJ_TRUE, so existing calls keep compiling; source and ABI compatible, so no rename and no shim. struct bj_enter_event.enter stays a bj_bool. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RMEMpDnGCSyhm2vxpWR5xtdraw.h: - bj_line_pixels / bj_circle_pixels / bj_grid_ray_cells -> bj_enumerate_line_pixels / bj_enumerate_circle_pixels / bj_enumerate_grid_ray_cells (R3). Old names kept as forwarders in src/deprecated.c, removed in 2.0. - enum bj_line_mode: BJ_LINE_STEPPED / BJ_LINE_WATERTIGHT -> BJ_LINE_MODE_STEPPED / BJ_LINE_MODE_WATERTIGHT (R11). Short names kept as deprecated #define aliases. - bj_draw_polyline / bj_draw_polyline_mode: the bj_bool loop argument becomes enum bj_polyline_end { BJ_POLYLINE_END_OPEN = 0, BJ_POLYLINE_END_CLOSED = 1 } (R9). Values match BJ_FALSE / BJ_TRUE, so the change is source- and ABI-compatible with no forwarder, exactly as bj_push_enter_event in commit 4. shader.h: - bj_shader_bitmap -> bj_shade_bitmap (R3), forwarder in src/deprecated.c. - enum bj_shader_flag: BJ_SHADER_INVERT_X ... -> BJ_SHADER_FLAG_* (R11); BJ_SHADER_STANDARD_FLAGS -> BJ_SHADER_FLAGS_STANDARD. Old names kept as deprecated #define aliases. pixel.h: - bj_make_pixel_rgb -> bj_unpack_pixel_rgb, bj_get_pixel_value -> bj_pack_pixel_rgb (R3 / R4), forwarders in src/deprecated.c. Internal callers in src/ migrated to the new names. Examples and tests migrated. test/deprecated_api.c gains a case per renamed group. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RMEMpDnGCSyhm2vxpWR5xtDoxygen builds a reserved "deprecated" page from the \deprecated commands the rename work adds. Markdown's auto-anchor for the CHANGELOG "### Deprecated" heading claimed that same id first, so doxygen aborted with "multiple use of section label 'deprecated'" (WARN_AS_ERROR). Pin the heading to {#changelog-deprecated}. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RMEMpDnGCSyhm2vxpWR5xtrandom.h: - bj_min_pcg32 / bj_max_pcg32 -> bj_pcg32_min / bj_pcg32_max (R4) - the bj_*_distribution family -> bj_random_<dist>[_<variant>]_<type>, type suffixes i32 / u32 / f32 / f64 / ld: bj_uniform_int32_distribution -> bj_random_uniform_i32 bj_uniform_uint32_distribution -> bj_random_uniform_u32 bj_uniform_float/double/long_double -> bj_random_uniform_f32/f64/ld bj_bernoulli_distribution -> bj_random_bernoulli bj_normal_float/double/long_double -> bj_random_normal_f32/f64/ld bj_normal_*_minmax_distribution -> bj_random_normal_range_f32/f64/ld - the bj_real dispatch macros bj_uniform_real_distribution / bj_normal_real_distribution / bj_normal_real_minmax_distribution -> bj_random_uniform / bj_random_normal / bj_random_normal_range - move the misplaced `#endif /* BJ_RANDOM_H */`: the three bj_normal_*_minmax_distribution decls were outside the include guard Old function names kept as forwarders in src/deprecated.c; old macro names kept as deprecated #defines. src/random_*.c, the six maze builders, examples and tests migrated. test/deprecated_api.c gains a random case. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RMEMpDnGCSyhm2vxpWR5xtSlice 2 of the net.h rework (enums landed in the previous commit). Constructors / destructors (R7/R8): bj_listen_tcp -> bj_create_tcp_listener bj_connect_tcp[_to] -> bj_connect_tcp_stream[_to] bj_accept_tcp -> bj_accept_tcp_stream bj_close_tcp_stream -> bj_destroy_tcp_stream bj_close_tcp_listener-> bj_destroy_tcp_listener bj_open_udp -> bj_create_udp bj_close_udp -> bj_destroy_udp bj_close_datagram -> bj_destroy_datagram bj_free_address -> bj_destroy_address Operations, verb-first (R2/R3): bj_tcp_recv/peek/send/shutdown/wait -> bj_receive_tcp / bj_peek_tcp / bj_send_tcp / bj_shutdown_tcp / bj_wait_tcp bj_udp_recv/send/send_to/wait -> bj_receive_udp / bj_send_udp / bj_send_udp_to / bj_wait_udp Mutators / predicates / queries (R4/R5/R6/R9): bj_set_tcp_keepalive(stream, bj_bool) -> split into bj_enable_tcp_keepalive / bj_disable_tcp_keepalive bj_get_tcp_keepalive -> bj_tcp_has_keepalive bj_udp_available -> bj_udp_has_data bj_set_tcp_recv_timeout -> bj_set_tcp_receive_timeout bj_get_tcp_recv_timeout -> bj_tcp_receive_timeout bj_get_tcp_send_timeout -> bj_tcp_send_timeout bj_address_string -> bj_address_to_string bj_datagram_addr/len -> bj_datagram_address / bj_datagram_length Old names kept as forwarders in src/deprecated.c. Both backends, the net examples and test/unit_net.c migrated. test/deprecated_api.c gains a net-function case. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RMEMpDnGCSyhm2vxpWR5xt_radangle params c5c3f03bdaBig pass on API symbol namings for readability purposeto Big pass on API symbol namings for readability purpose (#180)