00001 /** 00002 * \file 00003 * PETSCII/ASCII conversion functions. 00004 * \author Adam Dunkels <adam@dunkels.com> 00005 * 00006 * The Commodore based Contiki targets all have a special character 00007 * encoding called PETSCII which differs from the ASCII encoding that 00008 * normally is used for representing characters. 00009 * 00010 * \note For targets that do not use PETSCII encoding the C compiler 00011 * define WITH_ASCII should be used to avoid the PETSCII converting 00012 * functions. 00013 * 00014 */ 00015 00016 /* 00017 * Copyright (c) 2002, Adam Dunkels. 00018 * All rights reserved. 00019 * 00020 * Redistribution and use in source and binary forms, with or without 00021 * modification, are permitted provided that the following conditions 00022 * are met: 00023 * 1. Redistributions of source code must retain the above copyright 00024 * notice, this list of conditions and the following disclaimer. 00025 * 2. Redistributions in binary form must reproduce the above 00026 * copyright notice, this list of conditions and the following 00027 * disclaimer in the documentation and/or other materials provided 00028 * with the distribution. 00029 * 3. The name of the author may not be used to endorse or promote 00030 * products derived from this software without specific prior 00031 * written permission. 00032 * 00033 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 00034 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00035 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00036 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 00037 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00038 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 00039 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00040 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00041 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00042 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00043 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00044 * 00045 * This file is part of the Contiki desktop environment for the C64. 00046 * 00047 * $Id: petsciiconv.h,v 1.1 2006/06/17 22:41:18 adamdunkels Exp $ 00048 * 00049 */ 00050 #ifndef __PETSCIICONV_H__ 00051 #define __PETSCIICONV_H__ 00052 00053 #ifdef WITH_PETSCII 00054 00055 #include "contiki-conf.h" 00056 00057 /** 00058 * Convert a text buffer from PETSCII to ASCII. 00059 * 00060 * \param buf A pointer to the buffer which is to be converted. 00061 * \param len The length of the buffer to be converted. 00062 */ 00063 void petsciiconv_toascii(char *buf, unsigned int len); 00064 /** 00065 * Convert a text buffer from ASCII to PETSCII. 00066 * 00067 * \param buf A pointer to the buffer which is to be converted. 00068 * \param len The length of the buffer to be converted. 00069 */ 00070 void petsciiconv_topetscii(char *buf, unsigned int len); 00071 00072 #else /* WITH_PETSCII */ 00073 00074 #define petsciiconv_toascii(buf, len) 00075 #define petsciiconv_topetscii(buf, len) 00076 00077 #endif /* WITH_PETSCII */ 00078 00079 #endif /* __PETSCIICONV_H__ */