From 805b28fc2e633bcd9c823a4b23614378ebfd50a1 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Tue, 12 May 2026 16:52:28 +0800
Subject: [PATCH] update APUE socket project

---
 project/2.socketd/booster/database.h |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/project/2.socketd/booster/database.h b/project/2.socketd/booster/database.h
index f64771d..3ec26e6 100644
--- a/project/2.socketd/booster/database.h
+++ b/project/2.socketd/booster/database.h
@@ -22,13 +22,13 @@
  *              $db_file: sqlite database file name
  * return value: <0: failure   0:ok
  * */
-extern int database_init(const char *db_file);
+extern int db_open(const char *db_file);
 
 
 /*  description: close sqlite database handler
  * return value: none
  */
-extern void database_term(void);
+extern void db_close(void);
 
 
 /*  description: push a blob packet into database
@@ -37,24 +37,26 @@
  *               $size:  blob packet data bytes
  * return value: <0: failure   0:ok
  */
-extern int database_push_packet(void *pack, int size);
+extern int db_write(const void *pack, int size);
 
 
 /*  description: pop the first blob packet from database
  *   input args:
- *               $pack:  blob packet output buffer address
- *               $size:  blob packet output buffer size
- *               $byte:  blob packet bytes
+ *               $pack :  blob packet output buffer address
+ *               $size :  blob packet output buffer size
+ *               $byte :  blob packet bytes
+ *               $rowid:  rowid of the record
  * return value: <0: failure   0:ok
  */
-extern int database_pop_packet(void *pack, int size, int *bytes);
+extern int db_read(void *pack, int size, int *bytes, int *rowid);
 
 
 /*  description: remove the first blob packet from database
- *   input args: none
+ *   input args:
+ *               $rowid:  rowid of the record
  * return value: <0: failure   0:ok
  */
-extern int database_del_packet(void);
+extern int db_remove(int rowid);
 
 
 #endif   /* ----- #ifndef _DATABASE_H_  ----- */

--
Gitblit v1.9.1