Ignore:
Timestamp:
Sep 14, 2010, 1:13:20 AM (15 years ago)
Author:
bird
Message:

kash: trimmed down the arith stuff, making it not drag in libc bits.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/arith_lex.l

    r1233 r2415  
     1%option never-interactive
    12%option noyywrap
     3%option noinput
     4%option nounput
     5%option noyyget_out
     6%option noyy_push_state
     7%option noyy_pop_state
     8%option noyy_top_state
     9%option noyy_scan_buffer
     10%option noyy_scan_bytes
     11%option noyy_scan_string
     12%option noyyget_extra
     13%option noyyset_extra
     14%option noyyget_leng
     15%option noyyget_text
     16%option noyyget_lineno
     17%option noyyset_lineno
     18%option noyyget_in
     19%option noyyset_in
     20%option noyyget_out
     21%option noyyset_out
     22%option noyyget_lval
     23%option noyyset_lval
     24%option noyyget_lloc
     25%option noyyset_lloc
     26%option noyyget_debug
     27%option noyyset_debug
     28%option noyyalloc
     29%option noyyrealloc
     30%option noyyfree
     31/** @todo %option reentrant */
    232%{
    333/*      $NetBSD: arith_lex.l,v 1.13 2005/03/21 22:37:09 dsl Exp $       */
     
    4373#endif
    4474
     75#include <stdio.h>
    4576#include "arith.h"
    4677#include "error.h"
     
    5687        result = (*buf = *arith_buf++) ? 1 : YY_NULL;
    5788#define YY_NO_UNPUT
     89
     90/* Avoid unnecessary libc bits. */
     91#undef  ECHO
     92#define ECHO \
     93        do {} while (0)
     94#undef  stdin
     95#define stdin  \
     96        NULL
     97#undef  stdout
     98#define stdout \
     99        NULL
     100#undef  fprintf
     101#define fprintf(a, b, c) \
     102        ((void)0)
     103#undef  exit
     104#define exit(rc) \
     105        do {} while (0)
     106#define YY_FATAL_ERROR(msg) \
     107        error(arith_psh, "arith: fatal error: %s", msg)
    58108%}
    59109
     
    102152#endif
    103153}
     154
     155void *
     156yyalloc(yy_size_t cb)
     157{
     158        return sh_malloc(NULL, cb);
     159}
     160
     161void *
     162yyrealloc(void *pv, yy_size_t cb)
     163{
     164        return sh_realloc(NULL, pv, cb);
     165}
     166
     167void
     168yyfree(void *pv)
     169{
     170        sh_free(NULL, pv);
     171}
     172
Note: See TracChangeset for help on using the changeset viewer.