apmdlex.l (719b9dc1afc07b94f216383e50f66f55e888c16d) | apmdlex.l (d50a71bdd882717df3f41dadd84ffc28f3466a1a) |
---|---|
1%{ 2/*- 3 * APM (Advanced Power Management) Event Dispatcher 4 * 5 * Copyright (c) 1999 Mitsuru IWASAKI <iwasaki@FreeBSD.org> 6 * Copyright (c) 1999 KOIE Hidetaka <koie@suri.co.jp> 7 * All rights reserved. 8 * --- 13 unchanged lines hidden (view full) --- 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * | 1%{ 2/*- 3 * APM (Advanced Power Management) Event Dispatcher 4 * 5 * Copyright (c) 1999 Mitsuru IWASAKI <iwasaki@FreeBSD.org> 6 * Copyright (c) 1999 KOIE Hidetaka <koie@suri.co.jp> 7 * All rights reserved. 8 * --- 13 unchanged lines hidden (view full) --- 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * |
30 * $FreeBSD$ | 30 * $Id: apmdlex.l,v 1.1.3.5 1999/06/08 09:01:47 koie Exp $ |
31 */ 32 33#include <string.h> 34#include <syslog.h> 35#include <bitstring.h> 36#include "apmd.h" 37#include "y.tab.h" 38 --- 30 unchanged lines hidden (view full) --- 69<TOP>POWERSTATECHANGE { yylval.ev = EVENT_POWERSTATECHANGE; return EVENT; } 70<TOP>UPDATETIME { yylval.ev = EVENT_UPDATETIME; return EVENT; } 71<TOP>CRITSUSPEND { yylval.ev = EVENT_CRITSUSPEND; return EVENT; } 72<TOP>USERSTANDBYREQ { yylval.ev = EVENT_USERSTANDBYREQ; return EVENT; } 73<TOP>USERSUSPENDREQ { yylval.ev = EVENT_USERSUSPENDREQ; return EVENT; } 74<TOP>STANDBYRESUME { yylval.ev = EVENT_STANDBYRESUME; return EVENT; } 75<TOP>CAPABILITIESCHANGE { yylval.ev = EVENT_CAPABILITIESCHANGE; return EVENT; } 76 | 31 */ 32 33#include <string.h> 34#include <syslog.h> 35#include <bitstring.h> 36#include "apmd.h" 37#include "y.tab.h" 38 --- 30 unchanged lines hidden (view full) --- 69<TOP>POWERSTATECHANGE { yylval.ev = EVENT_POWERSTATECHANGE; return EVENT; } 70<TOP>UPDATETIME { yylval.ev = EVENT_UPDATETIME; return EVENT; } 71<TOP>CRITSUSPEND { yylval.ev = EVENT_CRITSUSPEND; return EVENT; } 72<TOP>USERSTANDBYREQ { yylval.ev = EVENT_USERSTANDBYREQ; return EVENT; } 73<TOP>USERSUSPENDREQ { yylval.ev = EVENT_USERSUSPENDREQ; return EVENT; } 74<TOP>STANDBYRESUME { yylval.ev = EVENT_STANDBYRESUME; return EVENT; } 75<TOP>CAPABILITIESCHANGE { yylval.ev = EVENT_CAPABILITIESCHANGE; return EVENT; } 76 |
77<TOP>apm_battery { return APMBATT; } 78 79<TOP>charging { return BATTCHARGE; } 80<TOP>discharging { return BATTDISCHARGE; } 81<TOP>[0-9]+% { 82 yylval.i = atoi(yytext); 83 return BATTPERCENT; 84 } 85<TOP>[0-9]+[Mm] { 86 yylval.i = -atoi(yytext); 87 return BATTTIME; 88 } 89 | |
90<TOP>exec { return EXECCMD; } 91<TOP>reject { return REJECTCMD; } 92 93<TOP>\{ { return BEGINBLOCK; } 94<TOP>\} { return ENDBLOCK; } 95<TOP>\"[^"]+\" { 96 int len = strlen(yytext) - 2; 97 if ((yylval.str = (char *) malloc(len + 1)) == NULL) --- 15 unchanged lines hidden --- | 77<TOP>exec { return EXECCMD; } 78<TOP>reject { return REJECTCMD; } 79 80<TOP>\{ { return BEGINBLOCK; } 81<TOP>\} { return ENDBLOCK; } 82<TOP>\"[^"]+\" { 83 int len = strlen(yytext) - 2; 84 if ((yylval.str = (char *) malloc(len + 1)) == NULL) --- 15 unchanged lines hidden --- |