#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include "../include/clens.h"
Functions | |
long | instrrev (char *str2, char *str1) |
Find the last occurance of str1 in str2. | |
char * | trim (char *str) |
Trim white space from str. | |
void | substr (char *destStr, char *srcStr, int offset, int len) |
Copy len characters from srcStr to destStr starting from offset. | |
int | lhs (char *str, char *key) |
If key matches the beginning of str, copy the value (ie the rest of the string minus key) to the global. variable rhs. | |
void | sortCoefs (long lb, long ub) |
Sort the global array of coefficients, coef[], within a region defined by lb and ub. | |
void | insertCam (CamNode *pCam) |
Insert a camera into the linked list of cameras such that cameras are alphabetized by make within models and models are in the same order as in "profile.txt". | |
void | insertLns (LnsNode *pLns) |
Insert a lens into the linked list of lenses such that lenses belonging to the same group are together. | |
int | check (int b, char *s) |
Utility function to print error messages from parsing the profile files. | |
long | processDbFile (char *s) |
Function to parse profile files. The Lens, Camera, and group linked lists are created here, and the coef[] array is populated. | |
long | processDbIndex (char *s) |
Parse the lines in the master profile file, "profile.txt". | |
long | readDataBase () |
Read lens calibration data from profile files. | |
CamNode * | findCamera (char *exifMake, char *exifModel) |
Look for a camera in the linked list of supported cameras. | |
int | inGroups (LnsNode *thisLens, CamNode *thisCamera) |
Look for a lens in the list of lens groups compatable with the camera. | |
LnsNode * | findLens (char *lens, CamNode *camera) |
Look for a lens in the linked list of supported lenses. The lens is checked to make sure it has been calibrated for the camera passed in. | |
LnsNode * | findLenses (CamNode *camera) |
Create a linked list of all calibrated lenses for the input camera. | |
Variables | |
prefType | pref |
Data structure to hold program preferences. | |
CamNode * | pCamHdr = NULL |
Points to the first camera in the linked list of supported cameras. | |
LnsNode * | pLnsHdr = NULL |
Points to the first lens in the linked list of supported lenses. | |
CamNode | pCurCam |
Current camera being read in from profiles. | |
LnsNode | pCurLns |
Current lens being read in from profiles. | |
CoefType | coef [10000] |
Array of lens correction coefficient data types. | |
long | coefIndex |
Next available slot in coef[]. Holds the total number of lens correction coefficients after all profiles are read. | |
char * | fileList [500] |
Array to hold the filenames contained in profile.txt. | |
long | fileIndex |
Next available slot in fileList[]. | |
char * | fileName |
Current profile file name being read from. | |
int | line |
Holds the value of the current line of being read in profile.txt. | |
char | rhs [256] |
String to hold the right hand side of a parsed line. | |
const long | PROCESS_VOID = 0 |
State value for parsing profile files. | |
const long | PROCESS_CAM = 1 |
State value for parsing profile files. | |
const long | PROCESS_LENS = 2 |
State value for parsing profile files. |
|
Utility function to print error messages from parsing the profile files.
|
|
Look for a camera in the linked list of supported cameras.
|
|
Look for a lens in the linked list of supported lenses. The lens is checked to make sure it has been calibrated for the camera passed in.
|
|
Create a linked list of all calibrated lenses for the input camera.
|
|
Look for a lens in the list of lens groups compatable with the camera.
|
|
Insert a camera into the linked list of cameras such that cameras are alphabetized by make within models and models are in the same order as in "profile.txt".
|
|
Insert a lens into the linked list of lenses such that lenses belonging to the same group are together.
|
|
Find the last occurance of str1 in str2.
|
|
If key matches the beginning of str, copy the value (ie the rest of the string minus key) to the global. variable rhs.
|
|
Function to parse profile files. The Lens, Camera, and group linked lists are created here, and the coef[] array is populated.
|
|
Parse the lines in the master profile file, "profile.txt".
|
|
Read lens calibration data from profile files.
|
|
Sort the global array of coefficients, coef[], within a region defined by lb and ub.
|
|
Copy len characters from srcStr to destStr starting from offset.
|
|
Trim white space from str.
|