Code:
while (fgets(line, sizeof(line), obstaclePositions_traj_file) )
fgets() will read at most one '\n', which will be the last character in 'line' if it exists.
Code:
token = strtok(line, "\n"); //Pull the string apart into tokens using the \n
Since there is only one '\n' in 'line' and it is at the end, strtok() will as a side effect change it to a '\0'. I.e. this line just removes the '\n' at the end of the 'line' using a rather unusual way.
Code:
for( token = strtok(line, "\t"); token ; token = strtok (NULL, "\t") )
The initialization part of the for-loop throws away the result from the previous strtok()-call, i.e. the previous call is completely unnecessary if you use strtok() with the delimiter "\t\n" in your for-loop. This will split the string into tokens separated by either '\t' or '\n'.
Code:
size_ob_list = op_prg_list_size (obstacle_list);
line_coord_list = op_prg_list_create();
for (k = 0; k <size_ob_list; k++)
{
line_coord_list = (List*)op_prg_list_access (obstacle_list, k);
It looks like you are accessing your lists using indices which is not very efficient. Why don't you use a simple loop which advances a pointer from one element to the next using the pointer to the next element?
Code:
coords = (char*)op_prg_list_access (line_coord_list, j);
printf("%c", coords);
Don't you get a warning when you compile? 'coords' seems to be a char pointer, but '%c' expects a char.
Bye, Andreas