Changeset 73f0a01 for lib


Ignore:
Timestamp:
2015-05-31T02:31:24Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
2ca933c
Parents:
6e21525
Message:

Move twitter_parse_id() to parse_int64() in misc.c

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/misc.c

    r6e21525 r73f0a01  
    751751        return end - string;
    752752}
     753
     754/* Parses a guint64 from string, returns TRUE on success */
     755gboolean parse_int64(char *string, int base, guint64 *number)
     756{
     757        guint64 parsed;
     758        char *endptr;
     759
     760        errno = 0;
     761        parsed = g_ascii_strtoull(string, &endptr, base);
     762        if (errno || endptr == string || *endptr != '\0') {
     763                return FALSE;
     764        }
     765        *number = parsed;
     766        return TRUE;
     767}
     768
  • lib/misc.h

    r6e21525 r73f0a01  
    149149G_MODULE_EXPORT char *get_rfc822_header(const char *text, const char *header, int len);
    150150G_MODULE_EXPORT int truncate_utf8(char *string, int maxlen);
     151G_MODULE_EXPORT gboolean parse_int64(char *string, int base, guint64 *number);
    151152
    152153#endif
Note: See TracChangeset for help on using the changeset viewer.