Adding custom fields

5.x-1.x-dev, Code, support request, normal, active

I want to add custom fields to the user (login) form.
I know my way around Drupal FAPI but are only beginning to familiarize myself with CiviCRM code.
Can you pls point me to code examples, documentation or functions I can use to realize this.
May thanks.