exzero.c 877 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*************************************************************************
  2. * Copyright (c) 2011 AT&T Intellectual Property
  3. * All rights reserved. This program and the accompanying materials
  4. * are made available under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution, and is available at
  6. * https://www.eclipse.org/legal/epl-v10.html
  7. *
  8. * Contributors: Details at https://graphviz.org
  9. *************************************************************************/
  10. /*
  11. * Glenn Fowler
  12. * AT&T Research
  13. *
  14. * expression library support
  15. */
  16. #include <expr/exlib.h>
  17. /*
  18. * return 0 value for type
  19. */
  20. Extype_t exzero(long int type) {
  21. Extype_t v = {0};
  22. switch (type)
  23. {
  24. case FLOATING:
  25. v.floating = 0.0;
  26. break;
  27. case INTEGER:
  28. case UNSIGNED:
  29. v.integer = 0;
  30. break;
  31. case STRING:
  32. v.string = expr.nullstring;
  33. break;
  34. }
  35. return v;
  36. }