int main(int argc, char** argv) { lib_func(); while (1) { sleep(1); } lib_func(); return 0; }
lib_func (int bar) { asm (""); STAP_PROBE1(test, func_count, bar); if (bar - foo > 0) foo = lib_func (bar - foo); return foo; }
static int lua_amf_buffer_write_uchar(lua_State *L) { amf_buf *b = luaL_checkudata(L, 1, "amf_buffer"); unsigned char c = (unsigned char)luaL_checkint(L, 2); amf_buf_append_char(b, c); return 0; } #define lib_func(name) { #name, lua_amf_##name } const struct luaL_Reg amf_lib[] = { lib_func(encode), lib_func(decode), lib_func(decode_msg), lib_func(encode_msg), lib_func(new_buffer), { NULL, NULL } }; const struct luaL_Reg amf_buf_lib[] = { { "write_uchar", lua_amf_buffer_write_uchar }, { "write_ushort", lua_amf_buffer_write_ushort }, { "write_int32", lua_amf_buffer_write_int32 }, { "write_str", lua_amf_buffer_write_str }, { "raw_string", lua_amf_buffer_raw_string }, { "__tostring", lua_amf_buffer_tostring }, { "__gc", lua_amf_buffer_free },
void lib_main () { foo = 1; foo = lib_func (3); }
int main(int argc, char* argv[]) { printf("Hello World, lib ret val(%i)\n", lib_func()); return 0; }