X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ensc_fmt%2Ffmt-internal.h;fp=ensc_fmt%2Ffmt-internal.h;h=0000000000000000000000000000000000000000;hb=db5ef3f969fc6ad34aeb5903e44d0049b2e50791;hp=5409422eba79295897e67e115d4edca1d4dfa30e;hpb=95e2774070e989fe9cf9f48dae5fa054e55e2a3e;p=util-vserver.git diff --git a/ensc_fmt/fmt-internal.h b/ensc_fmt/fmt-internal.h deleted file mode 100644 index 5409422..0000000 --- a/ensc_fmt/fmt-internal.h +++ /dev/null @@ -1,60 +0,0 @@ -// $Id: fmt-internal.h 1647 2004-08-19 13:53:54Z ensc $ --*- c -*-- - -// Copyright (C) 2003 Enrico Scholz -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; version 2 of the License. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - -#ifndef H_UTIL_VSERVER_LIB_FMT_COMMON_H -#define H_UTIL_VSERVER_LIB_FMT_COMMON_H - -#define DIGITS "0123456789abcdefghijklmnopqrstuvwxyz" - -#define FMT_P__(X,Y) X ## Y -#define FMT_P_(X,Y) FMT_P__(X,Y) -#define FMT_P(X) FMT_P_(FMT_PREFIX, X) - -#define CONCAT__(x,y,z) x ## y ## z -#define CONCAT_(x,y,z) CONCAT__(x,y,z) -#define CONCAT(x,z) CONCAT_(x, FMT_BITSIZE, z) - -#define FMT_FN(BASE,SZ) \ - do { \ - register __typeof__(val) v = val; \ - register size_t l = 0; \ - \ - if (ptr==0) { \ - do { \ - ++l; \ - v /= BASE; \ - } while (v!=0); \ - } \ - else { \ - char buf[sizeof(val)*SZ]; \ - \ - do { \ - register unsigned int d = v%BASE; \ - v /= BASE; \ - ++l; \ - buf[sizeof(buf)-l] = DIGITS[d]; \ - } while (v!=0); \ - \ - memcpy(ptr, buf+sizeof(buf)-l, l); \ - } \ - \ - return l; \ - } while (0) - - -#endif // H_UTIL_VSERVER_LIB_FMT_COMMON_H