comparison util-src/ringbuffer.c @ 12976:a187600ec7d6

util: Add compat for prosody module name change to C sources
author Kim Alvefur <zash@zash.se>
date Fri, 17 Mar 2023 18:03:07 +0100
parents 1f6f05a98fcd
children 2bcabbeac9b0
comparison
equal deleted inserted replaced
12975:d10957394a3c 12976:a187600ec7d6
311 lua_setmetatable(L, -2); 311 lua_setmetatable(L, -2);
312 312
313 return 1; 313 return 1;
314 } 314 }
315 315
316 int luaopen_util_ringbuffer(lua_State *L) { 316 int luaopen_prosody_util_ringbuffer(lua_State *L) {
317 luaL_checkversion(L); 317 luaL_checkversion(L);
318 318
319 if(luaL_newmetatable(L, "ringbuffer_mt")) { 319 if(luaL_newmetatable(L, "ringbuffer_mt")) {
320 lua_pushcfunction(L, rb_tostring); 320 lua_pushcfunction(L, rb_tostring);
321 lua_setfield(L, -2, "__tostring"); 321 lua_setfield(L, -2, "__tostring");
351 lua_createtable(L, 0, 1); 351 lua_createtable(L, 0, 1);
352 lua_pushcfunction(L, rb_new); 352 lua_pushcfunction(L, rb_new);
353 lua_setfield(L, -2, "new"); 353 lua_setfield(L, -2, "new");
354 return 1; 354 return 1;
355 } 355 }
356
357 int luaopen_util_ringbuffer(lua_State *L) {
358 return luaopen_prosody_util_ringbuffer(L);
359 }