plugin_registry.template 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. %YAML 1.2
  2. ---
  3. foreach: libs
  4. cond: selected.get('generate_plugin_registry', False)
  5. output_name: ${selected.name}_plugin_registry.c
  6. template: |
  7. /*
  8. *
  9. * Copyright 2016, Google Inc.
  10. * All rights reserved.
  11. *
  12. * Redistribution and use in source and binary forms, with or without
  13. * modification, are permitted provided that the following conditions are
  14. * met:
  15. *
  16. * * Redistributions of source code must retain the above copyright
  17. * notice, this list of conditions and the following disclaimer.
  18. * * Redistributions in binary form must reproduce the above
  19. * copyright notice, this list of conditions and the following disclaimer
  20. * in the documentation and/or other materials provided with the
  21. * distribution.
  22. * * Neither the name of Google Inc. nor the names of its
  23. * contributors may be used to endorse or promote products derived from
  24. * this software without specific prior written permission.
  25. *
  26. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  27. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  28. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  29. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  30. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  31. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  32. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  33. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  34. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  35. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  36. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  37. *
  38. */
  39. #include <grpc/grpc.h>
  40. %for plugin in selected.plugins:
  41. extern void ${plugin}_init(void);
  42. extern void ${plugin}_shutdown(void);
  43. %endfor
  44. void grpc_register_built_in_plugins(void) {
  45. %for plugin in selected.plugins:
  46. grpc_register_plugin(${plugin}_init,
  47. ${plugin}_shutdown);
  48. %endfor
  49. }