00001 /*<std-header orig-src='shore'> 00002 00003 $Id: w_form_base.cpp,v 1.2 2010/05/26 01:20:25 nhall Exp $ 00004 00005 SHORE -- Scalable Heterogeneous Object REpository 00006 00007 Copyright (c) 1994-99 Computer Sciences Department, University of 00008 Wisconsin -- Madison 00009 All Rights Reserved. 00010 00011 Permission to use, copy, modify and distribute this software and its 00012 documentation is hereby granted, provided that both the copyright 00013 notice and this permission notice appear in all copies of the 00014 software, derivative works or modified versions, and any portions 00015 thereof, and that both notices appear in supporting documentation. 00016 00017 THE AUTHORS AND THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY 00018 OF WISCONSIN - MADISON ALLOW FREE USE OF THIS SOFTWARE IN ITS 00019 "AS IS" CONDITION, AND THEY DISCLAIM ANY LIABILITY OF ANY KIND 00020 FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 00021 00022 This software was developed with support by the Advanced Research 00023 Project Agency, ARPA order number 018 (formerly 8230), monitored by 00024 the U.S. Army Research Laboratory under contract DAAB07-91-C-Q518. 00025 Further funding for this work was provided by DARPA through 00026 Rome Research Laboratory Contract No. F30602-97-2-0247. 00027 00028 */ 00029 00030 #include "w_defines.h" 00031 00032 /* -- do not edit anything above this line -- </std-header>*/ 00033 00034 /* 00035 * This software is Copyright 1989, 1991, 1992, 1993, 1994, 1998, 00036 * 2003, 2004 by: 00037 * 00038 * Josef Burger <bolo@cs.wisc.edu> 00039 * 00040 * All Rights Reserved. 00041 * 00042 * This software may be freely used as long as credit is given 00043 * to the author and this copyright is maintained. 00044 */ 00045 00046 #include "w_form.h" 00047 00048 // XXX an alias would be better, but this works 00049 #define w_form form 00050 00051 // really want this from the include, but compatability problems 00052 // with anything wanting to use form() are an issue. 00053 extern const char *w_form(const char *, ...); 00054 00055 00056 #define FMT(name, type, format) \ 00057 const char *name(type t, int length) \ 00058 { \ 00059 return w_form(format, length, t); \ 00060 } 00061 00062 FMT(dec, int, "%*d") 00063 FMT(dec, unsigned, "%*u") 00064 FMT(dec, long, "%*ld") 00065 FMT(dec, unsigned long, "%*lu") 00066 00067 FMT(hex, int, "%*x") 00068 FMT(hex, unsigned, "%*x") 00069 FMT(hex, long, "%*lx") 00070 FMT(hex, unsigned long, "%*lx") 00071 00072 FMT(oct, int, "%*o") 00073 FMT(oct, unsigned, "%*o") 00074 FMT(oct, long, "%*lo") 00075 FMT(oct, unsigned long, "%*lo") 00076 00077