def source_header(filename, target_name, ltag):
    """Returns lines that begin a source file"""
    return ['// Generated by the lua-protobuf compiler',
        "// You shouldn't edit this file manually", '//', 
        '// source proto file: %s' % filename, '', '#include "%s.pb-lua.h"' %
        target_name, '', '#ifdef __cplusplus',
        'extern "C" { // make sure functions treated with C naming',
        '#endif', '', '#include <lauxlib.h>', '', '#ifdef __cplusplus', '}',
        '#endif', '', '#include <string>', '',
        '// this represents Lua udata for a protocol buffer message',
        '// we record where a message came from so we can GC it properly',
        'typedef struct msg_udata { // confuse over-simplified pretty-printer',
        '    ::google::protobuf::Message%s * msg;' % ltag,
        '    bool lua_owns;', '    lua_protobuf_gc_callback gc_callback;',
        '    void * callback_data;', '} msg_udata;', '']
