# SFBPrint.h

Go to the documentation of this file.

    00001 /*                                              -*- mode:C++; fill-column:100 -*-
    00002   SFBPrint.h - Generalized print formatting routines
    00003   Copyright (C) 2009 The Regents of the University of New Mexico.  All rights reserved.
    00004
    00005   This library is free software; you can redistribute it and/or
    00006   modify it under the terms of the GNU Lesser General Public
    00007   License as published by the Free Software Foundation; either
    00008   version 2.1 of the License, or (at your option) any later version.
    00009
    00010   This library is distributed in the hope that it will be useful,
    00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013   Lesser General Public License for more details.
    00014
    00015   You should have received a copy of the GNU General Public License
    00016   along with this library; if not, write to the Free Software
    00017   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
    00018   USA
    00019
    00020   $Id$
    00021 */
    00022
    00029 #ifndef SFBPRINT_H
    00030 #define SFBPRINT_H
    00031
    00032 #include "SFBConstants.h"       /* For FACE_COUNT */
    00033 #include "SFBAlarm.h"           /* For SFBAlarmIndexType */
    00034 #include "SFBReactor.h"         /* For PacketHandler, Body */
    00035 #include "SFBFrame.h"
    00036
    00037 /* The 'plain function' print methods dish to all reflex-controlled faces! */
    00038
    00039 extern void print(const char * str);
    00040
    00041 extern void print(const u8 * str, u32 len);
    00042
    00043 extern void print(int decimal);
    00044
    00045 extern void print(unsigned int decimal);
    00046
    00047 extern void print(long decimal);
    00048
    00049 extern void print(unsigned long decimal);
    00050
    00051 extern void print(long decimal, int code);
    00052
    00053 extern void print(double val);
    00054
    00055 extern void printFace();
    00056
    00057
    00058 extern void println();
    00059
    00060 extern void println(const char * str);
    00061
    00062 extern void println(const u8 * str, u32 len);
    00063
    00064 extern void println(int decimal);
    00065
    00066 extern void println(unsigned int decimal);
    00067
    00068 extern void println(long decimal);
    00069
    00070 extern void println(unsigned long decimal);
    00071
    00072 extern void println(long decimal, int code);
    00073
    00074 extern void println(double val);
    00075
    00076 extern void printlnCheckByte();
    00077
    00078
    00079 extern void facePrint(u8 face, const char * str);
    00080 extern void facePrint(u8 face, const u8 * str, u32 len);
    00081 extern void facePrint(u8 face, int decimal);
    00082 extern void facePrint(u8 face, unsigned int decimal);
    00083 extern void facePrint(u8 face, long decimal);
    00084 extern void facePrint(u8 face, unsigned long decimal);
    00085 //extern void facePrint(u8 face, long decimal, int code);
    00086 extern void facePrint(u8 face, unsigned long decimal, int code);
    00087 extern void facePrint(u8 face, double val);
    00088 extern void facePrint(u8 face, double val);
    00089 extern void facePrintFace(u8 face);
    00090
    00091 extern void facePrintln(u8 face);
    00092 extern void facePrintln(u8 face, const char * str);
    00093
    00094 extern void facePrintln(u8 face, const u8 * str, u32 len);
    00095
    00096 extern void facePrintln(u8 face, int decimal);
    00097
    00098 extern void facePrintln(u8 face, unsigned int decimal);
    00099
    00100 extern void facePrintln(u8 face, long decimal);
    00101
    00102 extern void facePrintln(u8 face, unsigned long decimal);
    00103
    00104 extern void facePrintln(u8 face, unsigned long decimal, int code);
    00107 extern void facePrintln(u8 face, double val);
    00108
    00109 extern void facePrintlnCheckByte(u8 face);
    00110
    00115 struct FacePrinter {
    00116   void (*print)(u8 face, u8 byte);
    00117   void (*println)(u8 face);
    00118   void (*printFaceCode)(u8 face);
    00119
    00120   const char * (*getFaceName)(u8 face);
    00121
    00122 };
    00123
    00124 extern bool faceHasPrinter(u8 face);
    00125 extern bool faceFindFreeFace(u8 & foundFace);
    00126 extern void faceSetPrinter(u8 face, const FacePrinter * handler) ;
    00127 extern void faceUnsetPrinter(u8 face) ;
    00128
    00129 /* The one-time serial startup code */
    00130 extern void print_startup_initialization() ;
    00131
    00132 #endif  /* SFBPRINT_H */
    00133