Steven He / Mbed 2 deprecated StringMatchingProtothread

Dependencies:   mbed

Committer:
StevenHe
Date:
Wed Dec 01 04:39:00 2010 +0000
Revision:
0:544b5f6ad832

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
StevenHe 0:544b5f6ad832 1 /*
StevenHe 0:544b5f6ad832 2 * Copyright (c) 2004-2005, Swedish Institute of Computer Science.
StevenHe 0:544b5f6ad832 3 * All rights reserved.
StevenHe 0:544b5f6ad832 4 *
StevenHe 0:544b5f6ad832 5 * Redistribution and use in source and binary forms, with or without
StevenHe 0:544b5f6ad832 6 * modification, are permitted provided that the following conditions
StevenHe 0:544b5f6ad832 7 * are met:
StevenHe 0:544b5f6ad832 8 * 1. Redistributions of source code must retain the above copyright
StevenHe 0:544b5f6ad832 9 * notice, this list of conditions and the following disclaimer.
StevenHe 0:544b5f6ad832 10 * 2. Redistributions in binary form must reproduce the above copyright
StevenHe 0:544b5f6ad832 11 * notice, this list of conditions and the following disclaimer in the
StevenHe 0:544b5f6ad832 12 * documentation and/or other materials provided with the distribution.
StevenHe 0:544b5f6ad832 13 * 3. Neither the name of the Institute nor the names of its contributors
StevenHe 0:544b5f6ad832 14 * may be used to endorse or promote products derived from this software
StevenHe 0:544b5f6ad832 15 * without specific prior written permission.
StevenHe 0:544b5f6ad832 16 *
StevenHe 0:544b5f6ad832 17 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
StevenHe 0:544b5f6ad832 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
StevenHe 0:544b5f6ad832 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
StevenHe 0:544b5f6ad832 20 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
StevenHe 0:544b5f6ad832 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
StevenHe 0:544b5f6ad832 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
StevenHe 0:544b5f6ad832 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
StevenHe 0:544b5f6ad832 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
StevenHe 0:544b5f6ad832 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
StevenHe 0:544b5f6ad832 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
StevenHe 0:544b5f6ad832 27 * SUCH DAMAGE.
StevenHe 0:544b5f6ad832 28 *
StevenHe 0:544b5f6ad832 29 * This file is part of the Contiki operating system.
StevenHe 0:544b5f6ad832 30 *
StevenHe 0:544b5f6ad832 31 * Author: Adam Dunkels <adam@sics.se>
StevenHe 0:544b5f6ad832 32 *
StevenHe 0:544b5f6ad832 33 * $Id: lc-addrlabels.h,v 1.4 2006/06/03 11:29:43 adam Exp $
StevenHe 0:544b5f6ad832 34 */
StevenHe 0:544b5f6ad832 35
StevenHe 0:544b5f6ad832 36 /**
StevenHe 0:544b5f6ad832 37 * \addtogroup lc
StevenHe 0:544b5f6ad832 38 * @{
StevenHe 0:544b5f6ad832 39 */
StevenHe 0:544b5f6ad832 40
StevenHe 0:544b5f6ad832 41 /**
StevenHe 0:544b5f6ad832 42 * \file
StevenHe 0:544b5f6ad832 43 * Implementation of local continuations based on the "Labels as
StevenHe 0:544b5f6ad832 44 * values" feature of gcc
StevenHe 0:544b5f6ad832 45 * \author
StevenHe 0:544b5f6ad832 46 * Adam Dunkels <adam@sics.se>
StevenHe 0:544b5f6ad832 47 *
StevenHe 0:544b5f6ad832 48 * This implementation of local continuations is based on a special
StevenHe 0:544b5f6ad832 49 * feature of the GCC C compiler called "labels as values". This
StevenHe 0:544b5f6ad832 50 * feature allows assigning pointers with the address of the code
StevenHe 0:544b5f6ad832 51 * corresponding to a particular C label.
StevenHe 0:544b5f6ad832 52 *
StevenHe 0:544b5f6ad832 53 * For more information, see the GCC documentation:
StevenHe 0:544b5f6ad832 54 * http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html
StevenHe 0:544b5f6ad832 55 *
StevenHe 0:544b5f6ad832 56 */
StevenHe 0:544b5f6ad832 57
StevenHe 0:544b5f6ad832 58 #ifndef __LC_ADDRLABELS_H__
StevenHe 0:544b5f6ad832 59 #define __LC_ADDRLABELS_H__
StevenHe 0:544b5f6ad832 60
StevenHe 0:544b5f6ad832 61 /** \hideinitializer */
StevenHe 0:544b5f6ad832 62 typedef void * lc_t;
StevenHe 0:544b5f6ad832 63
StevenHe 0:544b5f6ad832 64 #define LC_INIT(s) s = NULL
StevenHe 0:544b5f6ad832 65
StevenHe 0:544b5f6ad832 66 #define LC_RESUME(s) \
StevenHe 0:544b5f6ad832 67 do { \
StevenHe 0:544b5f6ad832 68 if(s != NULL) { \
StevenHe 0:544b5f6ad832 69 goto *s; \
StevenHe 0:544b5f6ad832 70 } \
StevenHe 0:544b5f6ad832 71 } while(0)
StevenHe 0:544b5f6ad832 72
StevenHe 0:544b5f6ad832 73 #define LC_CONCAT2(s1, s2) s1##s2
StevenHe 0:544b5f6ad832 74 #define LC_CONCAT(s1, s2) LC_CONCAT2(s1, s2)
StevenHe 0:544b5f6ad832 75
StevenHe 0:544b5f6ad832 76 #define LC_SET(s) \
StevenHe 0:544b5f6ad832 77 do { \
StevenHe 0:544b5f6ad832 78 LC_CONCAT(LC_LABEL, __LINE__): \
StevenHe 0:544b5f6ad832 79 (s) = &&LC_CONCAT(LC_LABEL, __LINE__); \
StevenHe 0:544b5f6ad832 80 } while(0)
StevenHe 0:544b5f6ad832 81
StevenHe 0:544b5f6ad832 82 #define LC_END(s)
StevenHe 0:544b5f6ad832 83
StevenHe 0:544b5f6ad832 84 #endif /* __LC_ADDRLABELS_H__ */
StevenHe 0:544b5f6ad832 85 /** @} */