Skip to content
Snippets Groups Projects
Select Git revision
  • 9e19366acf617fbe31392ced17a1f2d457c21cda
  • master default
  • trunk
  • RELEASE_6_5_DRIVEDB
  • RELEASE_6_6_DRIVEDB
  • RELEASE_7_0_DRIVEDB
  • RELEASE_7_2_DRIVEDB
  • RELEASE_7_3_DRIVEDB
  • RELEASE_6_0_DRIVEDB
  • RELEASE_6_1_DRIVEDB
  • RELEASE_6_2_DRIVEDB
  • RELEASE_6_3_DRIVEDB
  • RELEASE_6_4_DRIVEDB
  • tags/RELEASE_7_4
  • tags/RELEASE_7_3
  • RELEASE_5_41_DRIVEDB
  • RELEASE_5_42_DRIVEDB
  • RELEASE_5_43_DRIVEDB
  • tags/RELEASE_7_2
  • tags/RELEASE_7_1
  • tags/RELEASE_7_0
  • RELEASE_5_40_DRIVEDB
22 results

ataprint.cpp

Blame
  • ataprint.cpp 81.84 KiB
    /*
     * ataprint.cpp
     *
     * Home page of code is: http://smartmontools.sourceforge.net
     *
     * Copyright (C) 2002-9 Bruce Allen <smartmontools-support@lists.sourceforge.net>
     * Copyright (C) 2008-9 Christian Franke <smartmontools-support@lists.sourceforge.net>
     * Copyright (C) 1999-2000 Michael Cornwell <cornwell@acm.org>
     *
     * 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; either version 2, or (at your option)
     * any later version.
     *
     * You should have received a copy of the GNU General Public License
     * (for example COPYING); if not, write to the Free
     * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     *
     * This code was originally developed as a Senior Thesis by Michael Cornwell
     * at the Concurrent Systems Laboratory (now part of the Storage Systems
     * Research Center), Jack Baskin School of Engineering, University of
     * California, Santa Cruz. http://ssrc.soe.ucsc.edu/
     *
     */
    
    #include "config.h"
    
    #include <ctype.h>
    #include <errno.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #ifdef HAVE_LOCALE_H
    #include <locale.h>
    #endif // #ifdef HAVE_LOCALE_H
    
    #include "int64.h"
    #include "atacmdnames.h"
    #include "atacmds.h"
    #include "dev_interface.h"
    #include "ataprint.h"
    #include "smartctl.h"
    #include "extern.h"
    #include "utility.h"
    #include "knowndrives.h"
    
    const char *ataprint_c_cvsid="$Id: ataprint.cpp,v 1.211 2009/06/13 14:56:20 chrfranke Exp $"
    ATACMDNAMES_H_CVSID ATACMDS_H_CVSID ATAPRINT_H_CVSID CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID KNOWNDRIVES_H_CVSID SMARTCTL_H_CVSID UTILITY_H_CVSID;
    
    // for passing global control variables
    extern smartmonctrl *con;
    
    static const char * infofound(const char *output) {
      return (*output ? output : "[No Information Found]");
    }
    
    
    /* For the given Command Register (CR) and Features Register (FR), attempts
     * to construct a string that describes the contents of the Status
     * Register (ST) and Error Register (ER).  The caller passes the string
     * buffer and the return value is a pointer to this string.  If the
     * meanings of the flags of the error register are not known for the given
     * command then it returns NULL.
     *
     * The meanings of the flags of the error register for all commands are
     * described in the ATA spec and could all be supported here in theory.
     * Currently, only a few commands are supported (those that have been seen
     * to produce errors).  If many more are to be added then this function
     * should probably be redesigned.
     */