|
TPCCLIB
|
Finding and verifying TPC study id number. Study number consists of a string of 1-5 letters (upper- or lower-case) followed by 1-5 digits. More...
#include "tpcclibConfig.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include "tpcextensions.h"Go to the source code of this file.
Functions | |
| int | studynrVerify (const char *s, int zero_ok) |
| int | studynrStandardize (char *s) |
| int | studynrFromFilename (const char *fname, char *studynr, int force) |
Finding and verifying TPC study id number. Study number consists of a string of 1-5 letters (upper- or lower-case) followed by 1-5 digits.
Definition in file studynr.c.
| int studynrFromFilename | ( | const char * | fname, |
| char * | studynr, | ||
| int | force ) |
Extract study number (max MAX_STUDYNR_LEN chars) from given file name.
If file name string includes path, the path is ignored. This function removes initial zeroes from the numerical part, and converts upper case letters to lower case, if necessary.
| fname | File name, which may include the path. |
| studynr | Pointer for the resulting study number. Memory must be allocated before calling this function (at least MAX_STUDYNR_LEN+1 characters). |
| force | Validity of studynr is verified (0) or not verified (1). |
Definition at line 79 of file studynr.c.
Referenced by tacRead().
| int studynrStandardize | ( | char * | s | ) |
Remove initial zeroes in the numerical part of the PET study number, and convert any capital letters to lower-case.
| s | Pointer to the study number string to be edited. |
Definition at line 47 of file studynr.c.
Referenced by studynrFromFilename().
| int studynrVerify | ( | const char * | s, |
| int | zero_ok ) |
Check that the argument string is a valid TPC study number containing 1-5 letters (upper or lower case) followed by 1-5 digits.
| s | Pointer to string to test. |
| zero_ok | Number part of study number may start with zero (1) or may not (0). |
Definition at line 22 of file studynr.c.
Referenced by studynrFromFilename().