EC000AA, EC000AB, EC000AC,....,EC752AC, EC752AD,...,ECZZZ98,ECZZZ99.
then following steps can be used to produce this ID sequence:
TCID_create(7,&tcidtag); TCID_add_sequence(tcidtag,"1-2","EC",STATIC); TCID_add_sequence(tcidtag,"3-5","000",RUNNING); TCID_add_sequence(tcidtag,"6-7","AA",RUNNING); TCID_save(tcidtag);
Once this is done, every time the function below is called, it returns the next id by incrementing it by one.
TCID_get_next_value(tcidtag,&nextValue);
#define RUNNING (1) |
Type of sequence
Running Sequence starts from alpha A to Z,a to z or Digit - 0 to 9
Definition at line 54 of file tcidcreator.h.
#define STATIC (2) |
TC_API int TCID_add_sequence | ( | tag_t | tcid, | |
char * | digSeq, | |||
char * | start, | |||
int | type | |||
) |
This function is used to add a sequence to the ID format.
tcid | (I) Tag of the ID Format. |
digSeq | (I) Specifies the sequence of Digits(e.g., 1-2, 3-5, etc) |
start | (I) Specifies the starting value of the sequence(e.g., 0, AA, AAA etc) |
type |
(I) Type of format, either STATIC or RUNNING. RUNNING sequence starts from alpha (A to Z, a to z) or it can start from numeric (0 to 9). STATIC sequence can be static string sequence. |
TC_API int TCID_ask_id_length | ( | tag_t | tcid, | |
int * | length | |||
) |
Returns ID length of a given TCID object
tcid | (I) |
length | (O) |
TC_API int TCID_ask_sequence | ( | tag_t | tcid, | |
int | index, | |||
char ** | digSeq, | |||
char ** | start, | |||
int * | type | |||
) |
Returns the sequence of the digits, starting value and type information of the sequence, at the specified index of the ID Format.
TC_API int TCID_create | ( | int | number_of_digits, | |
tag_t * | new_tcid | |||
) |
This function is used to create an ID format with the specified number of digits. The function TCID_add_sequence is used to add sequences to the newly create ID Format. The total number of digits specified through the TCID_add_sequence function calls must be equal to the number of digits (number_of_digits) used to create the ID Format.
number_of_digits | (I) Total number of digits required to create an ID Format |
new_tcid | (O) Tag of the new ID format. |
TC_API int TCID_delete | ( | tag_t | tcid | ) |
Deletes the ID format.
tcid | (I) Tag of the ID format. |
TC_API int TCID_get_initial_value | ( | tag_t | tcid, | |
char ** | initialValue | |||
) |
Returns the initial revision ID as per the ID format provided as input. This value is independent of the stored value. This function is used for revision ID generation only.
tcid | (I) Tag of the ID format |
initialValue | (OF) Initial revision ID value |
TC_API int TCID_get_next_value | ( | tag_t | tcid, | |
char ** | nextValue | |||
) |
Returns the next ID value based on the ID format provided as input.
tcid | (I) Tag of the ID format. |
nextValue | (OF) Next ID value. |
TC_API int TCID_get_succeeding_value | ( | tag_t | tcid, | |
char * | value, | |||
char ** | newValue | |||
) |
Returns the succeeding value of the ID provided as input and also as per the ID format provided as input. This value is independent of the stored value. This function is used for revision ID generation only.
tcid | (I) Tag of the ID format. |
value | (I) Revision ID provided as input |
newValue | (OF) Subsequent revision ID value obtained based on the input ID and ID format |
TC_API int TCID_number_of_sequences | ( | tag_t | tcid, | |
int * | n_sequences | |||
) |
Returns the number of sequences in an ID format.
tcid | (I) Tag of the ID format. |
n_sequences | (O) Number of sequence in the ID format |
TC_API int TCID_save | ( | tag_t | tcid | ) |
Saves the changes made to the ID format
tcid | (I) Tag of the ID format. |