Skip to content
Snippets Groups Projects
Select Git revision
  • 49b1ca9447d79cf5e6bcba0a33b0468fcbcb6319
  • master default protected
  • legacy
  • jdk-17.0.13-ga-legacy
  • jdk-17.0.14+4
  • jdk-17.0.14+3
  • jdk-17.0.14+2
  • jdk-17.0.14+1
  • jdk-17.0.13-ga
  • jdk-17.0.13+11
  • jdk-17.0.13+10
  • jdk-17.0.13+9
  • jdk-17.0.13+8
  • jdk-17.0.13+7
  • jdk-17.0.13+6
  • jdk-17.0.14+0
  • jdk-17.0.13+5
  • jdk-17.0.13+4
  • jdk-17.0.13+3
  • jdk-17.0.13+2
  • jdk-17.0.13+1
  • jdk-17.0.13+0
  • jdk-17.0.12-ga
23 results

IdentityScope.java

Blame
  • ataprint.cpp 57.79 KiB
    /*
     * ataprint.c
     *
     * Home page of code is: http://smartmontools.sourceforge.net
     *
     * Copyright (C) 2002-4 Bruce Allen <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 <ctype.h>
    #include <stdio.h>
    #include <string.h>
    #include "atacmdnames.h"
    #include "atacmds.h"
    #include "ataprint.h"
    #include "smartctl.h"
    #include "int64.h"
    #include "extern.h"
    #include "utility.h"
    #include "knowndrives.h"
    #include "config.h"
    
    const char *ataprint_c_cvsid="$Id: ataprint.cpp,v 1.149 2004/04/02 05:57:40 ballen4705 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;
    
    // to hold onto exit code for atexit routine
    extern int exitstatus;
    
    // Copies n bytes (or n-1 if n is odd) from in to out, but swaps adjacents
    // bytes.
    void swapbytes(char *out, const char *in, size_t n)
    {
      size_t i;
    
      for (i = 0; i < n; i += 2) {
        out[i]   = in[i+1];
        out[i+1] = in[i];
      }
    }
    
    // Copies in to out, but removes leading and trailing whitespace.
    void trim(char *out, const char *in)
    {
      int i, first, last;
    
      // Find the first non-space character (maybe none).
      first = -1;
      for (i = 0; in[i]; i++)
        if (!isspace((int)in[i])) {
          first = i;
          break;
        }