Some doubts about IR and IRRemoteLibrary

Hello, I'm trying to add a new protocol to this library, making thus use of rawbuf to get protocol infos.
Problem is that I don't know much about ir in general and I have following questions:
1)Why first rawbuf element is ignored?
2)How is a ir protocol generally made? I mean is there a common structure?I see there are marks and spaces...what are them?And every protocol always starts with a mark?

  1. Why first rawbuf element is ignored?

The first element is the time between the start of looking for a code and the time the code actually starts. It's has no meaning because it is just an accident of timing so it is generally ignored.

2)How is a ir protocol generally made? I mean is there a common structure?

Study the four protocols already supported by the library. Then study the raw data from your protocol to see how it differs from the supported protocols. Then you can base your protocol on the nearest supported protocol.