Skip to content
Snippets Groups Projects
Commit b6390832 authored by shattered's avatar shattered
Browse files

Rename formatdriveidstring() to format_ata_string(), since it only applies

to strings received from ATA/ATAPI devices.


git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2390 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent b340f409
No related branches found
No related tags found
No related merge requests found
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include "utility.h" #include "utility.h"
#include "knowndrives.h" #include "knowndrives.h"
const char *ataprint_c_cvsid="$Id: ataprint.cpp,v 1.178 2007/02/25 20:09:00 chrfranke Exp $" const char *ataprint_c_cvsid="$Id: ataprint.cpp,v 1.179 2007/04/05 18:23:29 shattered 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; 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 // for passing global control variables
...@@ -91,7 +91,7 @@ void trim(char *out, const char *in) ...@@ -91,7 +91,7 @@ void trim(char *out, const char *in)
} }
// Convenience function for formatting strings from ata_identify_device // Convenience function for formatting strings from ata_identify_device
void formatdriveidstring(char *out, const char *in, int n) void format_ata_string(char *out, const char *in, int n)
{ {
char tmp[65]; char tmp[65];
...@@ -520,9 +520,9 @@ int ataPrintDriveInfo (struct ata_identify_device *drive){ ...@@ -520,9 +520,9 @@ int ataPrintDriveInfo (struct ata_identify_device *drive){
char model[64], serial[64], firm[64], capacity[64]; char model[64], serial[64], firm[64], capacity[64];
// format drive information (with byte swapping as needed) // format drive information (with byte swapping as needed)
formatdriveidstring(model, (char *)drive->model,40); format_ata_string(model, (char *)drive->model,40);
formatdriveidstring(serial, (char *)drive->serial_no,20); format_ata_string(serial, (char *)drive->serial_no,20);
formatdriveidstring(firm, (char *)drive->fw_rev,8); format_ata_string(firm, (char *)drive->fw_rev,8);
// print out model, serial # and firmware versions (byte-swap ASCI strings) // print out model, serial # and firmware versions (byte-swap ASCI strings)
drivetype=lookupdrive(model, firm); drivetype=lookupdrive(model, firm);
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#ifndef ATAPRINT_H_ #ifndef ATAPRINT_H_
#define ATAPRINT_H_ #define ATAPRINT_H_
#define ATAPRINT_H_CVSID "$Id: ataprint.h,v 1.29 2006/09/17 10:12:51 shattered Exp $\n" #define ATAPRINT_H_CVSID "$Id: ataprint.h,v 1.30 2007/04/05 18:23:29 shattered Exp $\n"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -54,7 +54,7 @@ int ataPrintSmartSelfTestlog(struct ata_smart_selftestlog *, int allentries); ...@@ -54,7 +54,7 @@ int ataPrintSmartSelfTestlog(struct ata_smart_selftestlog *, int allentries);
void ataPseudoCheckSmart(struct ata_smart_values *, struct ata_smart_thresholds_pvt *); void ataPseudoCheckSmart(struct ata_smart_values *, struct ata_smart_thresholds_pvt *);
// Convenience function for formatting strings from ata_identify_device. // Convenience function for formatting strings from ata_identify_device.
void formatdriveidstring(char *out, const char *in, int n); void format_ata_string(char *out, const char *in, int n);
int ataPrintMain(int fd); int ataPrintMain(int fd);
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "knowndrives.h" #include "knowndrives.h"
#include "utility.h" // includes <regex.h> #include "utility.h" // includes <regex.h>
const char *knowndrives_c_cvsid="$Id: knowndrives.cpp,v 1.159 2007/02/23 20:13:49 chrfranke Exp $" const char *knowndrives_c_cvsid="$Id: knowndrives.cpp,v 1.160 2007/04/05 18:23:29 shattered Exp $"
ATACMDS_H_CVSID ATAPRINT_H_CVSID CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID KNOWNDRIVES_H_CVSID UTILITY_H_CVSID; ATACMDS_H_CVSID ATAPRINT_H_CVSID CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID KNOWNDRIVES_H_CVSID UTILITY_H_CVSID;
#define MODEL_STRING_LENGTH 40 #define MODEL_STRING_LENGTH 40
...@@ -1328,8 +1328,8 @@ void showpresets(const struct ata_identify_device *drive){ ...@@ -1328,8 +1328,8 @@ void showpresets(const struct ata_identify_device *drive){
char model[MODEL_STRING_LENGTH+1], firmware[FIRMWARE_STRING_LENGTH+1]; char model[MODEL_STRING_LENGTH+1], firmware[FIRMWARE_STRING_LENGTH+1];
// get the drive's model/firmware strings // get the drive's model/firmware strings
formatdriveidstring(model, (char *)drive->model, MODEL_STRING_LENGTH); format_ata_string(model, (char *)drive->model, MODEL_STRING_LENGTH);
formatdriveidstring(firmware, (char *)drive->fw_rev, FIRMWARE_STRING_LENGTH); format_ata_string(firmware, (char *)drive->fw_rev, FIRMWARE_STRING_LENGTH);
// and search to see if they match values in the table // and search to see if they match values in the table
if ((i = lookupdrive(model, firmware)) < 0) { if ((i = lookupdrive(model, firmware)) < 0) {
...@@ -1375,8 +1375,8 @@ int applypresets(const struct ata_identify_device *drive, unsigned char **optspt ...@@ -1375,8 +1375,8 @@ int applypresets(const struct ata_identify_device *drive, unsigned char **optspt
opts=*optsptr; opts=*optsptr;
// get the drive's model/firmware strings // get the drive's model/firmware strings
formatdriveidstring(model, (char *)drive->model, MODEL_STRING_LENGTH); format_ata_string(model, (char *)drive->model, MODEL_STRING_LENGTH);
formatdriveidstring(firmware, (char *)drive->fw_rev, FIRMWARE_STRING_LENGTH); format_ata_string(firmware, (char *)drive->fw_rev, FIRMWARE_STRING_LENGTH);
// Look up the drive in knowndrives[]. // Look up the drive in knowndrives[].
if ((i = lookupdrive(model, firmware)) >= 0) { if ((i = lookupdrive(model, firmware)) >= 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment