firstly i would suggest moving your custom CMAP code into separate .c/.h files. make sure the .h contains declarations of your custom struct(s) and the functions to use them. provide the function implementations in the .c file. compile with
Code:
gcc cmap.c -c -o cmap.o
in the openssl file you want to use it, add
Code:
#include "cmap.h"
make sure to link to it when compiling openssl, by adding cmap.o to compile command

as for sharing the same CMAP struct instance between openssl, i think the easiest way would be to provide an accessor function
Code:
cmap* getCurrentCmap() {
  return myCmap;
}
where myCmap could be globally defined (better yet, as a member of some other object if possible). you would then add this function definition to the header file for the openssl code file you modified. in your custom project, add the appropriate include so you have the function definition (i'm assuming you're already doing this however). i don't think you need to do anything with extern, using this method.