List all nodes by logged in user in a custom module
There is module available https://drupal.org/project/usercontent still if you want to do it in custom module then here is the code: 


global $user;
  $node_query = db_select('node', 'n') 
  ->fields('n',array('nid'))
  ->condition("type", "node type")
  ->condition("uid", $user->uid)
  $node_result = $node_query->execute()->fetchAll();