···182182 ${CMAKE_CURRENT_SOURCE_DIR}/Accelerate/include
183183 ${CMAKE_CURRENT_SOURCE_DIR}/IOSurface/include
184184 ${CMAKE_CURRENT_SOURCE_DIR}/external/cocotron/OpenGL/include
185185+ ${CMAKE_CURRENT_SOURCE_DIR}/libquit/include
185186)
186187187188# It must be done in this scope
···355356add_subdirectory(Accelerate)
356357add_subdirectory(IOSurface)
357358add_subdirectory(external/cocotron/OpenGL)
359359+add_subdirectory(libquit)
358360359361# /Applications
360362#add_subdirectory(external/TextEdit)
···11+/*
22+ This file is part of Darling.
33+44+ Copyright (C) 2017 Lubos Dolezel
55+66+ Darling is free software: you can redistribute it and/or modify
77+ it under the terms of the GNU General Public License as published by
88+ the Free Software Foundation, either version 3 of the License, or
99+ (at your option) any later version.
1010+1111+ Darling is distributed in the hope that it will be useful,
1212+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1313+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1414+ GNU General Public License for more details.
1515+1616+ You should have received a copy of the GNU General Public License
1717+ along with Darling. If not, see <http://www.gnu.org/licenses/>.
1818+*/
1919+2020+2121+#ifndef _quit_H_
2222+#define _quit_H_
2323+2424+void* LQCachePort(void);
2525+void* LQForceQuit(void);
2626+void* LQNotifyCpuResource(void);
2727+void* LQNotifyFacelessQuitHappening(void);
2828+void* LQNotifyQuitLikely(void);
2929+void* LQNotifySpinLikely(void);
3030+void* LQNotifyStuckApp(void);
3131+void* LQNotifyUiQuitHappening(void);
3232+void* LQNotifyUnstuckApp(void);
3333+void* LQNotifyWakeupsResource(void);
3434+void* LQReportCpuResource(void);
3535+void* LQReportPotentialHang(void);
3636+void* LQReportPotentialSpin(void);
3737+void* LQReportStuckApp(void);
3838+void* LQReportUnstuckApp(void);
3939+void* LQReportWakeupsResource(void);
4040+4141+#endif
+110
src/libquit/src/quit.c
···11+/*
22+ This file is part of Darling.
33+44+ Copyright (C) 2017 Lubos Dolezel
55+66+ Darling is free software: you can redistribute it and/or modify
77+ it under the terms of the GNU General Public License as published by
88+ the Free Software Foundation, either version 3 of the License, or
99+ (at your option) any later version.
1010+1111+ Darling is distributed in the hope that it will be useful,
1212+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1313+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1414+ GNU General Public License for more details.
1515+1616+ You should have received a copy of the GNU General Public License
1717+ along with Darling. If not, see <http://www.gnu.org/licenses/>.
1818+*/
1919+2020+2121+#include <quit/quit.h>
2222+#include <stdlib.h>
2323+#include <stdio.h>
2424+2525+static int verbose = 0;
2626+2727+__attribute__((constructor))
2828+static void initme(void) {
2929+ verbose = getenv("STUB_VERBOSE") != NULL;
3030+}
3131+3232+void* LQCachePort(void) {
3333+ if (verbose) puts("STUB: LQCachePort called");
3434+ return NULL;
3535+}
3636+3737+void* LQForceQuit(void) {
3838+ if (verbose) puts("STUB: LQForceQuit called");
3939+ return NULL;
4040+}
4141+4242+void* LQNotifyCpuResource(void) {
4343+ if (verbose) puts("STUB: LQNotifyCpuResource called");
4444+ return NULL;
4545+}
4646+4747+void* LQNotifyFacelessQuitHappening(void) {
4848+ if (verbose) puts("STUB: LQNotifyFacelessQuitHappening called");
4949+ return NULL;
5050+}
5151+5252+void* LQNotifyQuitLikely(void) {
5353+ if (verbose) puts("STUB: LQNotifyQuitLikely called");
5454+ return NULL;
5555+}
5656+5757+void* LQNotifySpinLikely(void) {
5858+ if (verbose) puts("STUB: LQNotifySpinLikely called");
5959+ return NULL;
6060+}
6161+6262+void* LQNotifyStuckApp(void) {
6363+ if (verbose) puts("STUB: LQNotifyStuckApp called");
6464+ return NULL;
6565+}
6666+6767+void* LQNotifyUiQuitHappening(void) {
6868+ if (verbose) puts("STUB: LQNotifyUiQuitHappening called");
6969+ return NULL;
7070+}
7171+7272+void* LQNotifyUnstuckApp(void) {
7373+ if (verbose) puts("STUB: LQNotifyUnstuckApp called");
7474+ return NULL;
7575+}
7676+7777+void* LQNotifyWakeupsResource(void) {
7878+ if (verbose) puts("STUB: LQNotifyWakeupsResource called");
7979+ return NULL;
8080+}
8181+8282+void* LQReportCpuResource(void) {
8383+ if (verbose) puts("STUB: LQReportCpuResource called");
8484+ return NULL;
8585+}
8686+8787+void* LQReportPotentialHang(void) {
8888+ if (verbose) puts("STUB: LQReportPotentialHang called");
8989+ return NULL;
9090+}
9191+9292+void* LQReportPotentialSpin(void) {
9393+ if (verbose) puts("STUB: LQReportPotentialSpin called");
9494+ return NULL;
9595+}
9696+9797+void* LQReportStuckApp(void) {
9898+ if (verbose) puts("STUB: LQReportStuckApp called");
9999+ return NULL;
100100+}
101101+102102+void* LQReportUnstuckApp(void) {
103103+ if (verbose) puts("STUB: LQReportUnstuckApp called");
104104+ return NULL;
105105+}
106106+107107+void* LQReportWakeupsResource(void) {
108108+ if (verbose) puts("STUB: LQReportWakeupsResource called");
109109+ return NULL;
110110+}