Ahaggar: add the match_fncall() function

This function will:
* Parse the function call
* Check the function name
* Save the call in the substring parameter
* Return the target_functions struct that corresponds to the function
  name.

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
Ahaggar: add the function call iterator

* Add the function call iterator
* Create the substring

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
Ahaggar: check match_fncall() results

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
Ahaggar: complete the iterator logic

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
Ahaggar: fix a bug in the buffer expand logic

Commit 007c4a41450ebe4 makes the buffer size default to 4096 and the
explanation is not correct.

The error was on my part. When dealing with long buffers the expand()
logic will be automatically called, however in this function I did
forget to update the current offset.

Fix this bug by making the offset point to the new reallocated buffer

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
Ahaggar: force buffer to null terminate

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>