qnull.h 559 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * QNull
  3. *
  4. * Copyright (C) 2015 Red Hat, Inc.
  5. *
  6. * Authors:
  7. * Markus Armbruster <armbru@redhat.com>
  8. *
  9. * This work is licensed under the terms of the GNU LGPL, version 2.1
  10. * or later. See the COPYING.LIB file in the top-level directory.
  11. */
  12. #ifndef QNULL_H
  13. #define QNULL_H
  14. #include "qobject/qobject.h"
  15. struct QNull {
  16. struct QObjectBase_ base;
  17. };
  18. extern QNull qnull_;
  19. static inline QNull *qnull(void)
  20. {
  21. return qobject_ref(&qnull_);
  22. }
  23. void qnull_unref(QNull *q);
  24. G_DEFINE_AUTOPTR_CLEANUP_FUNC(QNull, qnull_unref)
  25. #endif /* QNULL_H */