* Parse an integer expression. * @retval *llp integer expression value * @param argInfo integer expression type * @param val integer expression string * @return 0 on success, otherwise POPT_* error. */
| 1079 | * @return 0 on success, otherwise POPT_* error. |
| 1080 | */ |
| 1081 | static int poptParseInteger(long long * llp, |
| 1082 | UNUSED(unsigned int argInfo), |
| 1083 | const char * val) |
| 1084 | { |
| 1085 | if (val) { |
| 1086 | char *end = NULL; |
| 1087 | *llp = strtoll(val, &end, 0); |
| 1088 | |
| 1089 | /* XXX parse scaling suffixes here. */ |
| 1090 | |
| 1091 | if (!(end && *end == '\0')) |
| 1092 | return POPT_ERROR_BADNUMBER; |
| 1093 | } else |
| 1094 | *llp = 0; |
| 1095 | return 0; |
| 1096 | } |
| 1097 | |
| 1098 | /** |
| 1099 | * Save the option argument through the (*opt->arg) pointer. |