Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

fmtlib.c

Go to the documentation of this file.
00001 /*      @(#)fmtlib.c    1.2     */
00002 #define MAXINTLENGTH 23
00003 
00004 #include "f2c.h"
00005 #ifndef Allow_TYQUAD
00006 #undef longint
00007 #define longint long
00008 #undef ulongint
00009 #define ulongint unsigned long
00010 #endif
00011 
00012 #ifdef KR_headers
00013 char *f__icvt(value,ndigit,sign, base) longint value; int *ndigit,*sign;
00014  register int base;
00015 #else
00016 char *f__icvt(longint value, int *ndigit, int *sign, int base)
00017 #endif
00018 {
00019         static char buf[MAXINTLENGTH+1];
00020         register int i;
00021         ulongint uvalue;
00022 
00023         if(value > 0) {
00024                 uvalue = value;
00025                 *sign = 0;
00026                 }
00027         else if (value < 0) {
00028                 uvalue = -value;
00029                 *sign = 1;
00030                 }
00031         else {
00032                 *sign = 0;
00033                 *ndigit = 1;
00034                 buf[MAXINTLENGTH-1] = '0';
00035                 return &buf[MAXINTLENGTH-1];
00036                 }
00037         i = MAXINTLENGTH;
00038         do {
00039                 buf[--i] = (uvalue%base) + '0';
00040                 uvalue /= base;
00041                 }
00042                 while(uvalue > 0);
00043         *ndigit = MAXINTLENGTH - i;
00044         return &buf[i];
00045         }
 

Powered by Plone

This site conforms to the following standards: