Sha256: 69f3af7820617b4ae1eaca7283b790bf15b1a709181d9fd6b73d01da16734c71

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

/*
 *  version_sorter.h
 *  version_sorter
 *
 *  Created by K. Adam Christensen on 10/10/09.
 *  Copyright 2009. All rights reserved.
 *
 */

#ifndef _VERSION_SORTER_H
#define _VERSION_SORTER_H

#if UNIT_TESTING

#define static

#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#if XCODE
#include <cmockery/cmockery.h>
#else
#include <cmockery.h>
#endif

#endif

#if defined(BUILD_FOR_RUBY)
#include <ruby.h>
#define DIE(msg) \
    rb_raise(rb_eRuntimeError, "%s", msg);
#else
#define DIE(msg) \
    fprintf(stderr, msg);\
    exit(EXIT_FAILURE);
#endif

typedef struct _VersionSortingItem {
    struct _VersionPiece *head;
    struct _VersionPiece *tail;
    int node_len;
    int widest_len;
    char *normalized;
    const char *original;
    size_t original_len;
    int original_idx;
} VersionSortingItem;

typedef struct _VersionPiece {
    char *str;
    int len;
    struct _VersionPiece *next;
} VersionPiece;

enum scan_state {
    digit, alpha, other
};

extern int* version_sorter_sort(char **, size_t);

#endif /* _VERSION_SORTER_H */

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
version_sorter-1.1.1 ext/version_sorter/version_sorter.h