mbox series

[0/3] connection: Refactor 'add_gateway'

Message ID 20231129045321.1263302-1-gerickson@nuovations.com (mailing list archive)
Headers show
Series connection: Refactor 'add_gateway' | expand

Message

Grant Erickson Nov. 29, 2023, 4:53 a.m. UTC
This refactors the 'add_gateway' function by:

    1. Leveraging early parameter checking, the 'g_autofree' pointer
       decoration, and the 'g_steal_pointer' macro to simplify exception
       handling.

    2. Changing the function signature by migrating the return type to
       a double-pointer parameter and changing the return type to an
       'int' for error status.

       This allows passing the full range of failure errors to the
       caller and allows the caller to pass those errors directly
       along as their own return status.

In addition, this documents the function.

Grant Erickson (3):
  connection: Simplify exception handling in 'add_gateway'.
  connection: Change the function signature of 'add_gateway'.
  connection: Document 'add_gateway'.

 src/connection.c | 124 +++++++++++++++++++++++++++++++++++------------
 1 file changed, 92 insertions(+), 32 deletions(-)