srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 1 | // support.cc |
| 2 | // Non-class support functions for gdisk program. |
| 3 | // Primarily by Rod Smith, February 2009, but with a few functions |
| 4 | // copied from other sources (see attributions below). |
| 5 | |
srs5694 | 221e087 | 2009-08-29 15:00:31 -0400 | [diff] [blame] | 6 | /* This program is copyright (c) 2009 by Roderick W. Smith. It is distributed |
| 7 | under the terms of the GNU GPL version 2, as detailed in the COPYING file. */ |
| 8 | |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 9 | #define __STDC_LIMIT_MACROS |
| 10 | #define __STDC_CONSTANT_MACROS |
| 11 | |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 12 | #include <stdio.h> |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 13 | #include <stdint.h> |
| 14 | #include <errno.h> |
srs5694 | e4ac11e | 2009-08-31 10:13:04 -0400 | [diff] [blame] | 15 | #include <fcntl.h> |
srs5694 | fed16d0 | 2010-01-27 23:03:40 -0500 | [diff] [blame] | 16 | #include <string.h> |
srs5694 | e35eb1b | 2009-09-14 00:29:34 -0400 | [diff] [blame] | 17 | #include <sys/stat.h> |
srs5694 | fed16d0 | 2010-01-27 23:03:40 -0500 | [diff] [blame] | 18 | #include <string> |
| 19 | #include <iostream> |
srs5694 | 08bb0da | 2010-02-19 17:19:55 -0500 | [diff] [blame] | 20 | #include <sstream> |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 21 | #include "support.h" |
| 22 | |
| 23 | #include <sys/types.h> |
| 24 | |
srs5694 | 5d58fe0 | 2010-01-03 20:57:08 -0500 | [diff] [blame] | 25 | // As of 1/2010, BLKPBSZGET is very new, so I'm explicitly defining it if |
| 26 | // it's not already defined. This should become unnecessary in the future. |
| 27 | // Note that this is a Linux-only ioctl.... |
| 28 | #ifndef BLKPBSZGET |
| 29 | #define BLKPBSZGET _IO(0x12,123) |
| 30 | #endif |
| 31 | |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 32 | using namespace std; |
| 33 | |
srs5694 | 9a46b04 | 2011-03-15 00:34:10 -0400 | [diff] [blame] | 34 | void ReadCString(char *inStr, int numchars) { |
| 35 | if (!fgets(inStr, numchars, stdin)) { |
srs5694 | bf8950c | 2011-03-12 01:23:12 -0500 | [diff] [blame] | 36 | cerr << "Critical error! Failed fgets() in ReadCString()\n"; |
| 37 | exit(1); |
| 38 | } // if |
srs5694 | bf8950c | 2011-03-12 01:23:12 -0500 | [diff] [blame] | 39 | } // ReadCString() |
| 40 | |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 41 | // Get a numeric value from the user, between low and high (inclusive). |
| 42 | // Keeps looping until the user enters a value within that range. |
| 43 | // If user provides no input, def (default value) is returned. |
| 44 | // (If def is outside of the low-high range, an explicit response |
| 45 | // is required.) |
srs5694 | fed16d0 | 2010-01-27 23:03:40 -0500 | [diff] [blame] | 46 | int GetNumber(int low, int high, int def, const string & prompt) { |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 47 | int response, num; |
| 48 | char line[255]; |
| 49 | |
| 50 | if (low != high) { // bother only if low and high differ... |
srs5694 | 0873e9d | 2010-10-07 13:00:45 -0400 | [diff] [blame] | 51 | do { |
srs5694 | fed16d0 | 2010-01-27 23:03:40 -0500 | [diff] [blame] | 52 | cout << prompt; |
| 53 | cin.getline(line, 255); |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 54 | num = sscanf(line, "%d", &response); |
| 55 | if (num == 1) { // user provided a response |
| 56 | if ((response < low) || (response > high)) |
srs5694 | fed16d0 | 2010-01-27 23:03:40 -0500 | [diff] [blame] | 57 | cout << "Value out of range\n"; |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 58 | } else { // user hit enter; return default |
| 59 | response = def; |
| 60 | } // if/else |
srs5694 | 0873e9d | 2010-10-07 13:00:45 -0400 | [diff] [blame] | 61 | } while ((response < low) || (response > high)); |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 62 | } else { // low == high, so return this value |
srs5694 | fed16d0 | 2010-01-27 23:03:40 -0500 | [diff] [blame] | 63 | cout << "Using " << low << "\n"; |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 64 | response = low; |
| 65 | } // else |
| 66 | return (response); |
| 67 | } // GetNumber() |
| 68 | |
| 69 | // Gets a Y/N response (and converts lowercase to uppercase) |
| 70 | char GetYN(void) { |
| 71 | char line[255]; |
srs5694 | 0873e9d | 2010-10-07 13:00:45 -0400 | [diff] [blame] | 72 | char response; |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 73 | |
srs5694 | 0873e9d | 2010-10-07 13:00:45 -0400 | [diff] [blame] | 74 | do { |
srs5694 | fed16d0 | 2010-01-27 23:03:40 -0500 | [diff] [blame] | 75 | cout << "(Y/N): "; |
srs5694 | 9a46b04 | 2011-03-15 00:34:10 -0400 | [diff] [blame] | 76 | ReadCString(line, sizeof(line)); |
srs5694 | 01f7f08 | 2011-03-15 23:53:31 -0400 | [diff] [blame^] | 77 | response = toupper(line[0]); |
srs5694 | 0873e9d | 2010-10-07 13:00:45 -0400 | [diff] [blame] | 78 | } while ((response != 'Y') && (response != 'N')); |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 79 | return response; |
| 80 | } // GetYN(void) |
| 81 | |
srs5694 | e4ac11e | 2009-08-31 10:13:04 -0400 | [diff] [blame] | 82 | // Obtains a sector number, between low and high, from the |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 83 | // user, accepting values prefixed by "+" to add sectors to low, |
srs5694 | 0873e9d | 2010-10-07 13:00:45 -0400 | [diff] [blame] | 84 | // or the same with "K", "M", "G", "T", or "P" as suffixes to add |
| 85 | // kilobytes, megabytes, gigabytes, terabytes, or petabytes, |
| 86 | // respectively. If a "-" prefix is used, use the high value minus |
| 87 | // the user-specified number of sectors (or KiB, MiB, etc.). Use the |
| 88 | // def value as the default if the user just hits Enter. The sSize is |
| 89 | // the sector size of the device. |
srs5694 | df9d363 | 2011-01-08 18:33:24 -0500 | [diff] [blame] | 90 | uint64_t GetSectorNum(uint64_t low, uint64_t high, uint64_t def, uint64_t sSize, |
| 91 | const string & prompt) { |
| 92 | uint64_t response; |
| 93 | char line[255]; |
srs5694 | 0873e9d | 2010-10-07 13:00:45 -0400 | [diff] [blame] | 94 | |
| 95 | do { |
srs5694 | fed16d0 | 2010-01-27 23:03:40 -0500 | [diff] [blame] | 96 | cout << prompt; |
| 97 | cin.getline(line, 255); |
srs5694 | 01f7f08 | 2011-03-15 23:53:31 -0400 | [diff] [blame^] | 98 | response = IeeeToInt(line, sSize, low, high, def); |
srs5694 | 0873e9d | 2010-10-07 13:00:45 -0400 | [diff] [blame] | 99 | } while ((response < low) || (response > high)); |
srs5694 | 55d9261 | 2010-03-07 22:16:07 -0500 | [diff] [blame] | 100 | return response; |
srs5694 | e4ac11e | 2009-08-31 10:13:04 -0400 | [diff] [blame] | 101 | } // GetSectorNum() |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 102 | |
srs5694 | 01f7f08 | 2011-03-15 23:53:31 -0400 | [diff] [blame^] | 103 | // Convert an IEEE-1541-2002 value (K, M, G, T, P, or E) to its equivalent in |
srs5694 | df9d363 | 2011-01-08 18:33:24 -0500 | [diff] [blame] | 104 | // number of sectors. If no units are appended, interprets as the number |
| 105 | // of sectors; otherwise, interprets as number of specified units and |
| 106 | // converts to sectors. For instance, with 512-byte sectors, "1K" converts |
| 107 | // to 2. If value includes a "+", adds low and subtracts 1; if SIValue |
srs5694 | 01f7f08 | 2011-03-15 23:53:31 -0400 | [diff] [blame^] | 108 | // inclues a "-", subtracts from high. If IeeeValue is empty, returns def. |
srs5694 | df9d363 | 2011-01-08 18:33:24 -0500 | [diff] [blame] | 109 | // Returns integral sector value. |
srs5694 | 01f7f08 | 2011-03-15 23:53:31 -0400 | [diff] [blame^] | 110 | uint64_t IeeeToInt(string inValue, uint64_t sSize, uint64_t low, uint64_t high, uint64_t def) { |
| 111 | uint64_t response = def, bytesPerUnit = 1, mult = 1, divide = 1; |
| 112 | size_t foundAt = 0; |
| 113 | char suffix, plusFlag = ' '; |
| 114 | string suffixes = "KMGTPE"; |
srs5694 | df9d363 | 2011-01-08 18:33:24 -0500 | [diff] [blame] | 115 | |
| 116 | if (sSize == 0) { |
| 117 | sSize = SECTOR_SIZE; |
| 118 | cerr << "Bug: Sector size invalid in SIToInt()!\n"; |
| 119 | } // if |
| 120 | |
| 121 | // Remove leading spaces, if present |
srs5694 | 01f7f08 | 2011-03-15 23:53:31 -0400 | [diff] [blame^] | 122 | while (inValue[0] == ' ') |
| 123 | inValue.erase(0, 1); |
srs5694 | df9d363 | 2011-01-08 18:33:24 -0500 | [diff] [blame] | 124 | |
srs5694 | 01f7f08 | 2011-03-15 23:53:31 -0400 | [diff] [blame^] | 125 | // If present, flag and remove leading plus or minus sign |
| 126 | if ((inValue[0] == '+') || (inValue[0] == '-')) { |
| 127 | plusFlag = inValue[0]; |
| 128 | inValue.erase(0, 1); |
srs5694 | df9d363 | 2011-01-08 18:33:24 -0500 | [diff] [blame] | 129 | } // if |
| 130 | |
| 131 | // Extract numeric response and, if present, suffix |
srs5694 | 01f7f08 | 2011-03-15 23:53:31 -0400 | [diff] [blame^] | 132 | istringstream inString(inValue); |
| 133 | if (((inString.peek() >= '0') && (inString.peek() <= '9')) || (inString.peek() == -1)) { |
| 134 | inString >> response >> suffix; |
| 135 | suffix = toupper(suffix); |
| 136 | |
| 137 | // If no response, or if response == 0, use default (def) |
| 138 | if ((inValue.length() == 0) || (response == 0)) { |
| 139 | response = def; |
| 140 | suffix = ' '; |
| 141 | plusFlag = 0; |
| 142 | } // if |
| 143 | |
| 144 | // Find multiplication and division factors for the suffix |
| 145 | foundAt = suffixes.find(suffix); |
| 146 | if (foundAt != string::npos) { |
| 147 | bytesPerUnit = UINT64_C(1) << (10 * (foundAt + 1)); |
| 148 | mult = bytesPerUnit / sSize; |
| 149 | divide = sSize / bytesPerUnit; |
| 150 | } // if |
| 151 | |
| 152 | // Adjust response based on multiplier and plus flag, if present |
| 153 | if (mult > 1) |
| 154 | response *= mult; |
| 155 | else if (divide > 1) |
| 156 | response /= divide; |
| 157 | if (plusFlag == '+') { |
| 158 | // Recompute response based on low part of range (if default = high |
| 159 | // value, which should be the case when prompting for the end of a |
| 160 | // range) or the defaut value (if default != high, which should be |
| 161 | // the case for the first sector of a partition). |
| 162 | if (def == high) |
| 163 | response = response + low - UINT64_C(1); |
| 164 | else |
| 165 | response = response + def; |
| 166 | } else if (plusFlag == '-') { |
| 167 | response = high - response; |
| 168 | } // if |
| 169 | } else { // user input is invalid |
srs5694 | df9d363 | 2011-01-08 18:33:24 -0500 | [diff] [blame] | 170 | response = high + UINT64_C(1); |
srs5694 | 01f7f08 | 2011-03-15 23:53:31 -0400 | [diff] [blame^] | 171 | } // if/else |
srs5694 | df9d363 | 2011-01-08 18:33:24 -0500 | [diff] [blame] | 172 | |
| 173 | return response; |
srs5694 | 01f7f08 | 2011-03-15 23:53:31 -0400 | [diff] [blame^] | 174 | } // IeeeToInt() |
srs5694 | df9d363 | 2011-01-08 18:33:24 -0500 | [diff] [blame] | 175 | |
srs5694 | 01f7f08 | 2011-03-15 23:53:31 -0400 | [diff] [blame^] | 176 | // Takes a size and converts this to a size in IEEE-1541-2002 units (KiB, MiB, |
| 177 | // GiB, TiB, PiB, or EiB), returned in C++ string form. The size is either in |
| 178 | // units of the sector size or, if that parameter is omitted, in bytes. |
srs5694 | 0873e9d | 2010-10-07 13:00:45 -0400 | [diff] [blame] | 179 | // (sectorSize defaults to 1). |
srs5694 | 01f7f08 | 2011-03-15 23:53:31 -0400 | [diff] [blame^] | 180 | string BytesToIeee(uint64_t size, uint32_t sectorSize) { |
| 181 | float sizeInIeee; |
| 182 | uint index = 0; |
| 183 | string units, prefixes = " KMGTPE"; |
srs5694 | 08bb0da | 2010-02-19 17:19:55 -0500 | [diff] [blame] | 184 | ostringstream theValue; |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 185 | |
srs5694 | 01f7f08 | 2011-03-15 23:53:31 -0400 | [diff] [blame^] | 186 | sizeInIeee = size * (float) sectorSize; |
| 187 | while ((sizeInIeee > 1024.0) && (index < (prefixes.length() - 1))) { |
| 188 | index++; |
| 189 | sizeInIeee /= 1024.0; |
| 190 | } // while |
srs5694 | 08bb0da | 2010-02-19 17:19:55 -0500 | [diff] [blame] | 191 | theValue.setf(ios::fixed); |
srs5694 | 01f7f08 | 2011-03-15 23:53:31 -0400 | [diff] [blame^] | 192 | if (prefixes[index] == ' ') { |
| 193 | units = " bytes"; |
srs5694 | 08bb0da | 2010-02-19 17:19:55 -0500 | [diff] [blame] | 194 | theValue.precision(0); |
srs5694 | fed16d0 | 2010-01-27 23:03:40 -0500 | [diff] [blame] | 195 | } else { |
srs5694 | 01f7f08 | 2011-03-15 23:53:31 -0400 | [diff] [blame^] | 196 | units = " iB"; |
| 197 | units[1] = prefixes[index]; |
srs5694 | 08bb0da | 2010-02-19 17:19:55 -0500 | [diff] [blame] | 198 | theValue.precision(1); |
srs5694 | fed16d0 | 2010-01-27 23:03:40 -0500 | [diff] [blame] | 199 | } // if/else |
srs5694 | 01f7f08 | 2011-03-15 23:53:31 -0400 | [diff] [blame^] | 200 | theValue << sizeInIeee << units; |
srs5694 | 08bb0da | 2010-02-19 17:19:55 -0500 | [diff] [blame] | 201 | return theValue.str(); |
srs5694 | 01f7f08 | 2011-03-15 23:53:31 -0400 | [diff] [blame^] | 202 | } // BlocksToIeee() |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 203 | |
srs5694 | 6699b01 | 2010-02-04 00:55:30 -0500 | [diff] [blame] | 204 | // Converts two consecutive characters in the input string into a |
| 205 | // number, interpreting the string as a hexadecimal number, starting |
| 206 | // at the specified position. |
| 207 | unsigned char StrToHex(const string & input, unsigned int position) { |
| 208 | unsigned char retval = 0x00; |
| 209 | unsigned int temp; |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 210 | |
srs5694 | 6699b01 | 2010-02-04 00:55:30 -0500 | [diff] [blame] | 211 | if (input.length() >= (position + 2)) { |
| 212 | sscanf(input.substr(position, 2).c_str(), "%x", &temp); |
| 213 | retval = (unsigned char) temp; |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 214 | } // if |
srs5694 | 6699b01 | 2010-02-04 00:55:30 -0500 | [diff] [blame] | 215 | return retval; |
| 216 | } // StrToHex() |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 217 | |
srs5694 | 0873e9d | 2010-10-07 13:00:45 -0400 | [diff] [blame] | 218 | // Returns 1 if input can be interpreted as a hexadecimal number -- |
| 219 | // all characters must be spaces, digits, or letters A-F (upper- or |
| 220 | // lower-case), with at least one valid hexadecimal digit; otherwise |
| 221 | // returns 0. |
| 222 | int IsHex(const string & input) { |
| 223 | int isHex = 1, foundHex = 0, i; |
| 224 | |
| 225 | for (i = 0; i < (int) input.length(); i++) { |
| 226 | if ((input[i] < '0') || (input[i] > '9')) { |
| 227 | if ((input[i] < 'A') || (input[i] > 'F')) { |
| 228 | if ((input[i] < 'a') || (input[i] > 'f')) { |
| 229 | if ((input[i] != ' ') && (input[i] != '\n')) { |
| 230 | isHex = 0; |
| 231 | } |
| 232 | } else foundHex = 1; |
| 233 | } else foundHex = 1; |
| 234 | } else foundHex = 1; |
| 235 | } // for |
| 236 | if (!foundHex) |
| 237 | isHex = 0; |
| 238 | return isHex; |
| 239 | } // IsHex() |
| 240 | |
srs5694 | 2a9f5da | 2009-08-26 00:48:01 -0400 | [diff] [blame] | 241 | // Return 1 if the CPU architecture is little endian, 0 if it's big endian.... |
| 242 | int IsLittleEndian(void) { |
| 243 | int littleE = 1; // assume little-endian (Intel-style) |
| 244 | union { |
| 245 | uint32_t num; |
| 246 | unsigned char uc[sizeof(uint32_t)]; |
| 247 | } endian; |
| 248 | |
| 249 | endian.num = 1; |
| 250 | if (endian.uc[0] != (unsigned char) 1) { |
| 251 | littleE = 0; |
| 252 | } // if |
| 253 | return (littleE); |
| 254 | } // IsLittleEndian() |
| 255 | |
| 256 | // Reverse the byte order of theValue; numBytes is number of bytes |
srs5694 | 221e087 | 2009-08-29 15:00:31 -0400 | [diff] [blame] | 257 | void ReverseBytes(void* theValue, int numBytes) { |
srs5694 | fed16d0 | 2010-01-27 23:03:40 -0500 | [diff] [blame] | 258 | char* tempValue = NULL; |
srs5694 | 2a9f5da | 2009-08-26 00:48:01 -0400 | [diff] [blame] | 259 | int i; |
| 260 | |
srs5694 | cb76c67 | 2010-02-11 22:22:22 -0500 | [diff] [blame] | 261 | tempValue = new char [numBytes]; |
srs5694 | fed16d0 | 2010-01-27 23:03:40 -0500 | [diff] [blame] | 262 | if (tempValue != NULL) { |
| 263 | memcpy(tempValue, theValue, numBytes); |
| 264 | for (i = 0; i < numBytes; i++) |
| 265 | ((char*) theValue)[i] = tempValue[numBytes - i - 1]; |
srs5694 | cb76c67 | 2010-02-11 22:22:22 -0500 | [diff] [blame] | 266 | delete[] tempValue; |
srs5694 | fed16d0 | 2010-01-27 23:03:40 -0500 | [diff] [blame] | 267 | } // if |
srs5694 | 2a9f5da | 2009-08-26 00:48:01 -0400 | [diff] [blame] | 268 | } // ReverseBytes() |
| 269 | |
srs5694 | 9ddc14b | 2010-08-22 22:44:42 -0400 | [diff] [blame] | 270 | // Extract integer data from argument string, which should be colon-delimited |
| 271 | uint64_t GetInt(const string & argument, int itemNum) { |
srs5694 | 64cbd17 | 2011-03-01 22:03:54 -0500 | [diff] [blame] | 272 | uint64_t retval; |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 273 | |
srs5694 | 64cbd17 | 2011-03-01 22:03:54 -0500 | [diff] [blame] | 274 | istringstream inString(GetString(argument, itemNum)); |
srs5694 | 9ddc14b | 2010-08-22 22:44:42 -0400 | [diff] [blame] | 275 | inString >> retval; |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 276 | return retval; |
srs5694 | 9ddc14b | 2010-08-22 22:44:42 -0400 | [diff] [blame] | 277 | } // GetInt() |
| 278 | |
| 279 | // Extract string data from argument string, which should be colon-delimited |
srs5694 | 9a46b04 | 2011-03-15 00:34:10 -0400 | [diff] [blame] | 280 | // If string begins with a colon, that colon is skipped in the counting. If an |
| 281 | // invalid itemNum is specified, returns an empty string. |
srs5694 | bf8950c | 2011-03-12 01:23:12 -0500 | [diff] [blame] | 282 | string GetString(string argument, int itemNum) { |
srs5694 | 9a46b04 | 2011-03-15 00:34:10 -0400 | [diff] [blame] | 283 | size_t startPos = 0, endPos = 0; |
| 284 | string retVal = ""; |
| 285 | int foundLast = 0; |
| 286 | int numFound = 0; |
srs5694 | 9ddc14b | 2010-08-22 22:44:42 -0400 | [diff] [blame] | 287 | |
srs5694 | 9a46b04 | 2011-03-15 00:34:10 -0400 | [diff] [blame] | 288 | if (argument[0] == ':') |
| 289 | argument.erase(0, 1); |
| 290 | while ((numFound < itemNum) && (!foundLast)) { |
srs5694 | 64cbd17 | 2011-03-01 22:03:54 -0500 | [diff] [blame] | 291 | endPos = argument.find(':', startPos); |
srs5694 | 9a46b04 | 2011-03-15 00:34:10 -0400 | [diff] [blame] | 292 | numFound++; |
| 293 | if (endPos == string::npos) { |
| 294 | foundLast = 1; |
| 295 | endPos = argument.length(); |
| 296 | } else if (numFound < itemNum) { |
| 297 | startPos = endPos + 1; |
| 298 | } // if/elseif |
| 299 | } // while |
| 300 | if ((numFound == itemNum) && (numFound > 0)) |
| 301 | retVal = argument.substr(startPos, endPos - startPos); |
srs5694 | 9ddc14b | 2010-08-22 22:44:42 -0400 | [diff] [blame] | 302 | |
srs5694 | 9a46b04 | 2011-03-15 00:34:10 -0400 | [diff] [blame] | 303 | return retVal; |
srs5694 | 01f7f08 | 2011-03-15 23:53:31 -0400 | [diff] [blame^] | 304 | } // GetString() |