rectangle.h 912 B

1234567891011121314151617181920212223242526272829303132333435
  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. #pragma once
  11. #include <stdbool.h>
  12. #include <stdint.h>
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. typedef struct Rect {
  17. int boundary[NUMSIDES];
  18. } Rect_t;
  19. void InitRect(Rect_t * r);
  20. #ifdef RTDEBUG
  21. void PrintRect(Rect_t *);
  22. #endif
  23. uint64_t RectArea(const Rect_t*);
  24. bool Overlap(const Rect_t*, const Rect_t*);
  25. Rect_t CombineRect(const Rect_t*, const Rect_t*);
  26. Rect_t NullRect(void);
  27. #ifdef __cplusplus
  28. }
  29. #endif