Back to index

courier  0.68.2
Functions
strofft.c File Reference
#include "numlib.h"
#include <string.h>

Go to the source code of this file.

Functions

char * libmail_str_off_t (off_t t, char *arg)
char * libmail_str_int64_t (int64_t t, char *arg)

Function Documentation

char* libmail_str_int64_t ( int64_t  t,
char *  arg 
)

Definition at line 38 of file strofft.c.

{
       char   buf[NUMBUFSIZE];
       char   *p=buf+sizeof(buf)-1;
       int    isneg=0;

       if (t < 0)
       {
              t= -t;
              isneg=1;
       }

       *p=0;
       do
       {
              *--p= '0' + (t % 10);
              t=t / 10;
       } while(t);

       if (isneg)
              *--p='-';

       return (strcpy(arg, p));
}

Here is the caller graph for this function:

char* libmail_str_off_t ( off_t  t,
char *  arg 
)

Definition at line 13 of file strofft.c.

{
       char   buf[NUMBUFSIZE];
       char   *p=buf+sizeof(buf)-1;
       int    isneg=0;

       if (t < 0)
       {
              t= -t;
              isneg=1;
       }

       *p=0;
       do
       {
              *--p= '0' + (t % 10);
              t=t / 10;
       } while(t);

       if (isneg)
              *--p='-';

       return (strcpy(arg, p));
}

Here is the caller graph for this function: