Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
da-liii committed Dec 3, 2023
1 parent fc7d565 commit 1679a56
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion TeXmacs/progs/prog/glue-symbols.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1126,5 +1126,5 @@
"show-meminfo"
"edit-special"
"xmacs-version"
"http-head"
"http-status-code"
))
6 changes: 3 additions & 3 deletions src/Scheme/L2/glue_lolly.lua
Original file line number Diff line number Diff line change
Expand Up @@ -920,9 +920,9 @@ function main()
}
},
{
scm_name = "http-head",
cpp_name = "lolly::io::http_head",
ret_type = "tree",
scm_name = "http-status-code",
cpp_name = "http_status_code",
ret_type = "long",
arg_list = {
"url"
}
Expand Down
11 changes: 11 additions & 0 deletions src/Scheme/L2/init_glue_l2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@
#include "file.hpp"
#include "locale.hpp"
#include "lolly/io/http.hpp"
#include "lolly/io/http_response.hpp"
#include "lolly/system/subprocess.hpp"
#include "sys_utils.hpp"
#include "tree.hpp"

#include "scheme.hpp"

using lolly::io::http_head;
using lolly::io::http_response_label;

tmscm
blackboxP (tmscm t) {
bool b= tmscm_is_blackbox (t);
Expand Down Expand Up @@ -54,6 +58,13 @@ lolly_version () {
return string (LOLLY_VERSION);
}

long
http_status_code (url u) {
long status_code= as<tree, long> (
http_response_ref (http_head (u), http_response_label::STATUS_CODE));
return status_code;
}

#include "glue_lolly.cpp"

void
Expand Down

0 comments on commit 1679a56

Please sign in to comment.