Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update/discuss design guidance #46

Closed
10 tasks
sergey-shandar opened this issue Oct 2, 2019 · 1 comment
Closed
10 tasks

Update/discuss design guidance #46

sergey-shandar opened this issue Oct 2, 2019 · 1 comment
Assignees
Labels
design-discussion An area of design currently under discussion and open to team and community feedback.

Comments

@sergey-shandar
Copy link
Contributor

sergey-shandar commented Oct 2, 2019

  • .h and .c template with _az_cfg_preffix.h, _az_cfg_suffix.h and _az_cfg_warn.h.
  • pure functions
  • az_result structure, see [Design] AZ_RESULT and simple output values. #59
  • in, in/out and out parameter conventions.
  • callback template
    1. Core library
      typedef void * az_context;
    2. interface
      typedef my_result my_callback_f(az_context context, my_parameter a);
      
      typedef struct {
        az_context context;
        my_callback_f * f;
      } my_callback;
      
      #define MY_CALLBACK_CAST(CONTEXT, NAME) \
        AZ_STATIC_ASSERT(sizeof(CONTEXT) == sizeof(az_context));
        static my_callback NAME( \
          CONTEXT const context, \
          my_result (* const f)(CONTEXT, my_parameter)) { \
          return (my_callback){ .context = (az_context)context, .f = (my_callback_f)f }; \
        }
    3. implementation
      struct my_context { … };
      int my_callback_implementation(my_context * const context, my_parameter m);
      MY_CALLBACK_CAST(my_context *, az_my_callback_implementation_cast);
  • a discriminated union for integers is an integer, examples az_result, char + EOF.
  • EOF convention
  • polymorphic iterator
  • reactive parsers
  • private fields
@gilbertw
Copy link

Guidelines are up to date.
https://azure.github.io/azure-sdk/general_introduction.html

@RickWinter RickWinter added design-discussion An area of design currently under discussion and open to team and community feedback. and removed Design labels Aug 2, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
design-discussion An area of design currently under discussion and open to team and community feedback.
Projects
None yet
Development

No branches or pull requests

3 participants