Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use std::ffi::CString;
extern {
pub fn php_info_print_table_start();
pub fn php_info_print_table_row(num_cols: c_int, ...) -> c_void;
pub fn php_info_print_table_header(num_cols: c_int, ...) -> c_void;
pub fn php_info_print_table_end();
}

Expand All @@ -30,6 +31,15 @@ pub fn print_table_row(key: &str, value: &str) {
};
}

/// Print the header of the PHP info table.
pub fn print_table_header(key: &str, value: &str) {
let v1 = CString::new(key).unwrap();
let v2 = CString::new(value).unwrap();
unsafe {
php_info_print_table_header(2, v1.as_ptr(), v2.as_ptr());
};
}

/// Ends the table
pub fn print_table_end() {
unsafe { php_info_print_table_end() }
Expand Down