Skip to content
Alexander Dahl edited this page Apr 8, 2015 · 9 revisions

Collected Ideas For a New API

  • use const char * instead of char * wherever possible, see e.g. branch constchar
  • remove md5(), see #15
  • some functions (e.g. session related ones) return 1 on success and 0 on error but should not
    • functions returning int (or some enum) as an error code should return 0 in case of success
    • functions returning bool should do explicitly (include stdbool.h) with the correct type and the name should remind you, this is somehow boolean
  • remove or implement cgi_session_set_max_idle_time() (at the moment it's a declaration in cgi.h only)
  • add an additional parameter to cgi_redirect() for specifying the HTTP response code, see e.g. branch redirect
  • prefix all exported symbols with cgi_ to avoid naming conflicts with code outside of this libraries scope
Clone this wiki locally