Qtopia library API Documentation

custom-ramses.h

00001 /**********************************************************************
00002 ** Copyright (C) 2000-2002 Trolltech AS.  All rights reserved.
00003 **
00004 ** This file is part of the Qtopia Environment.
00005 **
00006 ** This file may be distributed and/or modified under the terms of the
00007 ** GNU General Public License version 2 as published by the Free Software
00008 ** Foundation and appearing in the file LICENSE.GPL included in the
00009 ** packaging of this file.
00010 **
00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 **
00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00015 **
00016 ** Contact info@trolltech.com if any conditions of this licensing are
00017 ** not clear to you.
00018 **
00019 **********************************************************************/
00020 
00021 #define QPE_NEED_CALIBRATION
00022 #define QPE_HAVE_TOGGLELIGHT
00023 #define QPE_STARTMENU
00024 #define USE_REALTIME_AUDIO_THREAD
00025 #define OPIE_NEW_MALLOC
00026 
00027 
00028 #include <unistd.h>
00029 #include <stdio.h>
00030 #include <signal.h>
00031 #include <fcntl.h>
00032 #include <sys/ioctl.h>
00033 
00034 #define QPE_HAVE_MEMALERTER
00035 
00036 #define QPE_MEMALERTER_IMPL \
00037 static void sig_handler(int sig) \
00038 { \
00039     switch (sig) { \
00040     case SIGHUP: \
00041   memstate = VeryLow; \
00042   break; \
00043     case SIGUSR1: \
00044   memstate = Normal; \
00045   break; \
00046     case SIGUSR2: \
00047   memstate = Low; \
00048   break; \
00049     } \
00050 } \
00051 static void initMemalerter() \
00052 { \
00053     struct sigaction sa; \
00054     memset(&sa, '\0', sizeof sa); \
00055     sa.sa_handler = sig_handler; \
00056     sa.sa_flags = SA_RESTART; \
00057     if (sigaction(SIGHUP, &sa, NULL) < 0) { \
00058   return; \
00059     } \
00060     if (sigaction(SIGUSR1, &sa, NULL) < 0) { \
00061   return; \
00062     } \
00063     if (sigaction(SIGUSR2, &sa, NULL) < 0) { \
00064   return; \
00065     } \
00066     FILE *fo = fopen("/proc/sys/vm/freepg_signal_proc", "w"); \
00067      \
00068     if (!fo) \
00069         return; \
00070     fprintf(fo, "qpe\n"); \
00071     fclose(fo); \
00072 }
KDE Logo
This file is part of the documentation for OPIE Version 1.5.5.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:24:04 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001