Sorry, the question, as formulated, makes little sense, because there is no such thing.
File "extensions" are used primarily on Microsoft platforms, by historical reasons, and presently can be respected by some kinds of environments in other OS. The are not associated with data structures, and, in general case, not even with some certain file formats; they are associated with
some application installed in the system.
(Also, it's good to understand that, essentially, there are no file name "extension". This is the historical terms dated back to the time where 0 to 3-letter part of the name after dot at the end of the name was not really a part of the name, but a separate string known to the file system. Presently, all such file systems are obsolete; there can be accessed by modern software, but the former "extension" part is considered merely as a part of some naming convention. There is one single file name, without any special parts of it. The "extension", in Microsoft system, is known to the shell through some records written in the system registry.)
Can you see the difference? The "file type" is just the criterion for passing the file name to some application. The OS does not "know" anything about the file format. Moreover, formats, for the same extension, can be radically different. For example, rename a .html file to .docx and open in by MS Word. It will work, even though the formats are structurally unrelated. Words knows how to recognize those formats, that's it. Same thing about media files. For example, there is no such thing as .MPG, .MP4 or .MPEG file formats. MPEG-4 is a set of many standards, and different streams can be packed in a
media container of a number of different types. Some application can recognize some of those formats and than support or not support different stream formats inside. But don't think that it is done on a regular way, through the signature and metadata. There is no any universal standards used to classify files by formats through reading some initial portion of the file. Not all files have signatures, and not all files have metadata. The applications just try to recognize one or another file by some internal rules. In your application using your own file format, you will have to do the same. Not a big deal, believe me.
Unfortunately, you did not tag the OS and language you are using, but it's most likely that your are using Windows and C++. So, you may need to register your file type with your application. The best and the only fully consistent way to do so is
installation. I would highly recommend open-source WiX toolset, which is the most legitimate product for Microsoft technologies, especially modern MSBuild standard and Visual Studio. For this toolset, registration of file types is one of the standard chores:
WiX — Wikipedia, the free encyclopedia[
^],
WiX Toolset[
^].
In many cases, installation packages are not needed, but the need to register a file type makes it important. Most important part is that you have to give the option to uninstall the application and remove all traces of the installation from the system registry.
See also:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd758090%28v=vs.85%29.aspx[
^],
Best Practices for File Associations (Windows)[
^].
—SA