forked from troglobit/snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathccard.h
34 lines (29 loc) · 736 Bytes
/
ccard.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef CCARD_H
#define CCARD_H
enum ccard_type_ty
{
ccard_type_unknown,
ccard_type_mastercard,
ccard_type_visa,
ccard_type_amex,
ccard_type_diners,
ccard_type_discover,
ccard_type_enroute,
ccard_type_jcb,
ccard_type_bankcard
};
typedef enum ccard_type_ty ccard_type_ty;
enum ccard_error_ty
{
ccard_error_none = 0,
ccard_error_type_unknown,
ccard_error_non_numeric,
ccard_error_too_long,
ccard_error_length_incorrect,
ccard_error_checksum
};
typedef enum ccard_error_ty ccard_error_ty;
char *ccard_type_name (ccard_type_ty);
char *ccard_error_name (ccard_error_ty);
ccard_error_ty ccard_valid (char *, ccard_type_ty *);
#endif /* CCARD_H */