Defines | Functions | Variables

command.cpp File Reference

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <stdlib.h>
#include <unistd.h>
#include "marcmd.h"
#include "config.h"
#include "marglobals.h"
#include "esd.h"
#include "command.h"
Include dependency graph for command.cpp:

Go to the source code of this file.

Defines

#define TOUPPER(a)   for (j=strlen(a), i=0;i<j;i++ ) a[i] = toupper( a[i] )
#define TOLOWER(a)   for (j=strlen(a), i=0;i<j;i++ ) a[i] = tolower( a[i] )

Functions

float GetDiskSpace (char *)
void RemoveBlanks (char *)

Variables

char scan_in_progress
static float dfree
static float disk
static int first = 1

Define Documentation

#define TOLOWER (   a)    for (j=strlen(a), i=0;i<j;i++ ) a[i] = tolower( a[i] )

Definition at line 39 of file command.cpp.

#define TOUPPER (   a)    for (j=strlen(a), i=0;i<j;i++ ) a[i] = toupper( a[i] )

Definition at line 38 of file command.cpp.

Referenced by Command::exec_command().


Function Documentation

float GetDiskSpace ( char *  dir)

Definition at line 90 of file mardisk.c.

Referenced by Command::exec_command(), and MarHW::NotEnoughDiskSpace().

{
float           free= 999999.0 ;

        if (strlen(dir) < 1 ) return( free );

#ifdef __sgi
        if(statfs(dir, &disk, sizeof disk, 0) != 0) return( free );
#elif (__linux__ || __hpux || __DARWIN__)
        if(statfs(dir, &disk) != 0) return( free );
#elif ( SUN )
        if(statvfs(dir, &disk) != 0) return( free );
#elif __osf__
        if(statfs(dir, &disk, sizeof disk )  != 0 )return( free ); 
#endif

#ifdef __osf__ 
        free = (float)disk.f_bavail * (float)disk.f_fsize / 1024000.;
#else
        if(disk.f_blocks > 0)
                free = (float)disk.f_bfree * (float)disk.f_bsize / 1024000. ;
#endif

        return( free );
}
void RemoveBlanks ( char *  )

Definition at line 113 of file utils.c.

References i, and j.

Referenced by Command::BadInput(), GetConfig(), Getmar345Header(), GetmarNBHeader(), and Command::TestDirectory().

{
int i, j=0, len=strlen(str);

        for(i=0;i<len;i++) {
                if (!isspace(str[i]))
                        str[j++] = str[i];
        }
        if ( j>0)
                str[j] = 0;
}

Variable Documentation

float dfree [static]

Definition at line 48 of file command.cpp.

Referenced by Command::exec_command(), and MarHW::NotEnoughDiskSpace().

float disk

Definition at line 48 of file command.cpp.

Referenced by Command::exec_command(), GetDiskSpace(), IsNFS(), and MarHW::NotEnoughDiskSpace().

int first = 1 [static]

Definition at line 59 of file command.cpp.

Referenced by cbf_write_category(), and Command::exec_command().