Verified Commit ce6339d9 authored by Felix Häcker's avatar Felix Häcker
Browse files

Initial commit

parents
target/
Cargo.lock
**/*.rs.bk
vendor/
target
[submodule "gir-files"]
path = gir-files
url = https://github.com/gtk-rs/gir-files
[submodule "gir"]
path = gir
url = https://github.com/gtk-rs/gir
[workspace]
members = [
"soup",
"soup-sys",
"gir"
]
This diff is collapsed.
Subproject commit e586ff8cc061a716f28ad3e37f5db8a0cf06fbf5
Subproject commit 617a344b41061d8fbf6a7b04358357cc5c0886f0
[package]
name = "soup-sys"
version = "0.1.0"
links = "soup"
build = "build.rs"
authors = ["Felix Häcker <haeckerfelix@gnome.org>"]
[lib]
name = "soup_sys"
[dependencies]
libc = "0.2"
[dependencies.glib-sys]
git = "https://github.com/gtk-rs/sys"
[dependencies.gobject-sys]
git = "https://github.com/gtk-rs/sys"
[dependencies.gio-sys]
git = "https://github.com/gtk-rs/sys"
[build-dependencies]
pkg-config = "0.3.7"
[dev-dependencies]
shell-words = "0.1.0"
tempdir = "0.3"
[features]
v2_24 = []
v2_26 = ["v2_24"]
v2_26_3 = ["v2_26"]
v2_28 = ["v2_26_3"]
v2_30 = ["v2_28"]
v2_32 = ["v2_30"]
v2_34 = ["v2_32"]
v2_36 = ["v2_34"]
v2_38 = ["v2_36"]
v2_40 = ["v2_38"]
v2_42 = ["v2_40"]
v2_44 = ["v2_42"]
v2_46 = ["v2_44"]
v2_48 = ["v2_46"]
v2_50 = ["v2_48"]
v2_52 = ["v2_50"]
v2_54 = ["v2_52"]
v2_56 = ["v2_54"]
v2_58 = ["v2_56"]
v2_60 = ["v2_58"]
v2_62 = ["v2_60"]
dox = []
[options]
work_mode = "sys"
library = "Soup"
version = "2.4"
external_libraries = [
"GLib",
"GObject",
"Gio",
]
ignore = [
"Soup.MICRO_VERSION",
"Soup.MINOR_VERSION",
"Soup.VERSION_MIN_REQUIRED",
]
// This file was generated by gir (https://github.com/gtk-rs/gir @ e586ff8)
// from gir-files (https://github.com/gtk-rs/gir-files @ 617a344)
// DO NOT EDIT
extern crate pkg_config;
use pkg_config::{Config, Error};
use std::env;
use std::io::prelude::*;
use std::io;
use std::process;
fn main() {
if let Err(s) = find() {
let _ = writeln!(io::stderr(), "{}", s);
process::exit(1);
}
}
fn find() -> Result<(), Error> {
let package_name = "libsoup-2.4";
let shared_libs = ["soup-2.4"];
let version = if cfg!(feature = "v2_62") {
"2.62"
} else if cfg!(feature = "v2_60") {
"2.60"
} else if cfg!(feature = "v2_58") {
"2.58"
} else if cfg!(feature = "v2_56") {
"2.56"
} else if cfg!(feature = "v2_54") {
"2.54"
} else if cfg!(feature = "v2_52") {
"2.52"
} else if cfg!(feature = "v2_50") {
"2.50"
} else if cfg!(feature = "v2_48") {
"2.48"
} else if cfg!(feature = "v2_46") {
"2.46"
} else if cfg!(feature = "v2_44") {
"2.44"
} else if cfg!(feature = "v2_42") {
"2.42"
} else if cfg!(feature = "v2_40") {
"2.40"
} else if cfg!(feature = "v2_38") {
"2.38"
} else if cfg!(feature = "v2_36") {
"2.36"
} else if cfg!(feature = "v2_34") {
"2.34"
} else if cfg!(feature = "v2_32") {
"2.32"
} else if cfg!(feature = "v2_30") {
"2.30"
} else if cfg!(feature = "v2_28") {
"2.28"
} else if cfg!(feature = "v2_26_3") {
"2.26.3"
} else if cfg!(feature = "v2_26") {
"2.26"
} else {
"0.0"
};
if let Ok(inc_dir) = env::var("GTK_INCLUDE_DIR") {
println!("cargo:include={}", inc_dir);
}
if let Ok(lib_dir) = env::var("GTK_LIB_DIR") {
for lib_ in shared_libs.iter() {
println!("cargo:rustc-link-lib=dylib={}", lib_);
}
println!("cargo:rustc-link-search=native={}", lib_dir);
return Ok(())
}
let target = env::var("TARGET").expect("TARGET environment variable doesn't exist");
let hardcode_shared_libs = target.contains("windows");
let mut config = Config::new();
config.atleast_version(version);
config.print_system_libs(false);
if hardcode_shared_libs {
config.cargo_metadata(false);
}
match config.probe(package_name) {
Ok(library) => {
if let Ok(paths) = std::env::join_paths(library.include_paths) {
println!("cargo:include={}", paths.to_string_lossy());
}
if hardcode_shared_libs {
for lib_ in shared_libs.iter() {
println!("cargo:rustc-link-lib=dylib={}", lib_);
}
for path in library.link_paths.iter() {
println!("cargo:rustc-link-search=native={}",
path.to_str().expect("library path doesn't exist"));
}
}
Ok(())
}
Err(Error::EnvNoPkgConfig(_)) | Err(Error::Command { .. }) => {
for lib_ in shared_libs.iter() {
println!("cargo:rustc-link-lib=dylib={}", lib_);
}
Ok(())
}
Err(err) => Err(err),
}
}
This diff is collapsed.
This diff is collapsed.
// This file was generated by gir (https://github.com/gtk-rs/gir @ e586ff8)
// from gir-files (https://github.com/gtk-rs/gir-files @ 617a344)
// DO NOT EDIT
#include "manual.h"
#include <stdio.h>
int main() {
printf(_Generic((ABI_CONSTANT_NAME),
char *: "###gir test###%s###gir test###\n",
const char *: "###gir test###%s###gir test###\n",
char: "###gir test###%c###gir test###\n",
signed char: "###gir test###%hhd###gir test###\n",
unsigned char: "###gir test###%hhu###gir test###\n",
short int: "###gir test###%hd###gir test###\n",
unsigned short int: "###gir test###%hu###gir test###\n",
int: "###gir test###%d###gir test###\n",
unsigned int: "###gir test###%u###gir test###\n",
long: "###gir test###%ld###gir test###\n",
unsigned long: "###gir test###%lu###gir test###\n",
long long: "###gir test###%lld###gir test###\n",
unsigned long long: "###gir test###%llu###gir test###\n",
double: "###gir test###%f###gir test###\n",
long double: "###gir test###%ld###gir test###\n"),
ABI_CONSTANT_NAME);
return 0;
}
// This file was generated by gir (https://github.com/gtk-rs/gir @ e586ff8)
// from gir-files (https://github.com/gtk-rs/gir-files @ 617a344)
// DO NOT EDIT
#include "manual.h"
#include <stdalign.h>
#include <stdio.h>
int main() {
printf("%zu\n%zu", sizeof(ABI_TYPE_NAME), alignof(ABI_TYPE_NAME));
return 0;
}
// Feel free to edit this file, it won't be regenerated by gir generator unless removed.
#include <libsoup/soup.h>
[package]
name = "soup"
version = "0.1.0"
authors = ["Felix Häcker <haeckerfelix@gnome.org>"]
[dependencies]
soup-sys = { path="../soup-sys" }
libc = "0.2"
bitflags = "1.0"
lazy_static = "1.2.0"
glib-sys = { git="https://github.com/gtk-rs/sys" }
glib = { git="https://github.com/gtk-rs/glib" }
gobject-sys = { git="https://github.com/gtk-rs/sys" }
gio = { git="https://github.com/gtk-rs/gio" }
gio-sys = { git="https://github.com/gtk-rs/sys" }
futures-preview = { version = "0.3.0-alpha", optional = true }
fragile = "0.3.0"
[features]
default = ["v2_60"]
dox = []
v2_24 = []
v2_26 = ["v2_24", "soup-sys/v2_26"]
v2_26_3 = ["v2_26", "soup-sys/v2_26_3"]
v2_28 = ["v2_26_3", "soup-sys/v2_28"]
v2_30 = ["v2_28", "soup-sys/v2_30"]
v2_32 = ["v2_30", "soup-sys/v2_32"]
v2_34 = ["v2_32", "soup-sys/v2_34"]
v2_36 = ["v2_34", "soup-sys/v2_36"]
v2_38 = ["v2_36", "soup-sys/v2_38"]
v2_40 = ["v2_38", "soup-sys/v2_40"]
v2_42 = ["v2_40", "soup-sys/v2_42"]
v2_44 = ["v2_42", "soup-sys/v2_44"]
v2_46 = ["v2_44", "soup-sys/v2_46"]
v2_48 = ["v2_46", "soup-sys/v2_48"]
v2_50 = ["v2_48", "soup-sys/v2_50"]
v2_52 = ["v2_50", "soup-sys/v2_52"]
v2_54 = ["v2_52", "soup-sys/v2_54"]
v2_56 = ["v2_54", "soup-sys/v2_56"]
v2_58 = ["v2_56", "soup-sys/v2_58"]
v2_60 = ["v2_58", "soup-sys/v2_60"]
v2_62 = ["v2_60", "soup-sys/v2_62"]
futures = ["futures-preview", "glib/futures"]
[options]
girs_dir = "gir-files"
library = "Soup"
version = "2.4"
min_cfg_version = "2.4"
target_path = "."
work_mode = "normal"
generate_safety_asserts = true
deprecate_by_min_version = true
single_version_file = true
generate = [
#"Soup.Address", the trait `glib::translate::ToGlibPtr<'_, *mut libc::c_void>` is not implemented for `auto::address::Address
"Soup.AddressFamily",
"Soup.Auth",
"Soup.Message",
#"Soup.URI", types differ in mutability
"Soup.AuthBasic",
"Soup.AuthDigest",
#"Soup.AuthDomain",
#"Soup.AuthDomainFilter",
#"Soup.AuthDomainBasic",
#"Soup.AuthDomainDigest",
"Soup.SessionFeature",
"Soup.AuthManager",
"Soup.AuthNTLM",
"Soup.AuthNegotiate",
#"Soup.Buffer", types differ in mutability
"Soup.MemoryUse",
"Soup.Cache",
"Soup.Cacheability",
"Soup.CacheResponse",
"Soup.ChunkAllocator",
"Soup.ClientContext",
#"Soup.Socket", expected enum `libc::c_void`, found u8
#"Soup.Connection", gir backtrace
"Soup.ConnectionState",
"Soup.ContentDecoder",
"Soup.ContentSniffer",
"Soup.Date",
#"Soup.Cookie", types differ in mutability
"Soup.CookieJar",
"Soup.CookieJarAcceptPolicy",
"Soup.CookieJarDB",
"Soup.CookieJarText",
"Soup.DateFormat",
"Soup.Encoding",
"Soup.Expectation",
"Soup.HTTPVersion",
"Soup.KnownStatusCode",
#"Soup.Logger", the trait `glib::translate::Ptr` is not implemented for `i32
"Soup.LoggerLogLevel",
"Soup.Session",
"Soup.LoggerPrinter",
"Soup.LoggerFilter",
"Soup.MessageFlags",
"Soup.MessagePriority",
"Soup.Request",
#"Soup.MessageBody", expected enum `libc::c_void`, found u8
"Soup.MessageHeaders",
#"Soup.Range", gir backtrace
#"Soup.MessageHeadersIter", gir backtrace
#"Soup.MessageQueue", gir backtrace
#"Soup.MessageQueueItem", gir backtrace
"Soup.Multipart",
"Soup.MultipartInputStream",
"Soup.PasswordManager",
#"Soup.PasswordManagerInterface", gir backtrace
"Soup.ProxyResolver",
"Soup.ProxyURIResolver",
"Soup.ProxyResolverDefault",
#"Soup.ProxyResolverInterface", gir backtrace
#"Soup.ProxyURIResolverInterface", gir backtrace
"Soup.RequestData",
"Soup.RequestError",
"Soup.RequestFile",
"Soup.RequestHTTP",
"Soup.Requester",
"Soup.RequesterError",
#"Soup.Server",
"Soup.ServerListenOptions",
#"Soup.WebsocketConnection", expected enum `libc::c_void`, found u8
"Soup.SessionAsync",
#"Soup.SessionFeatureInterface", gir backtrace
"Soup.SessionSync",
"Soup.SocketIOStatus",
"Soup.Status",
"Soup.TLDError",
"Soup.WebsocketCloseCode",
"Soup.WebsocketState",
"Soup.WebsocketError",
"Soup.XMLRPCError",
"Soup.XMLRPCFault",
#"Soup.XMLRPCParams", gir backtrace
]
manual = [
"GLib.Error",
"Gio.InputStream",
"Gio.Cancellable",
]
This diff is collapsed.
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Auth;
use glib::translate::*;
use soup_sys;
use std::fmt;
glib_wrapper! {
pub struct AuthBasic(Object<soup_sys::SoupAuthBasic, AuthBasicClass>) @extends Auth;
match fn {
get_type => || soup_sys::soup_auth_basic_get_type(),
}
}
impl AuthBasic {}
impl fmt::Display for AuthBasic {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "AuthBasic")
}
}
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Auth;
use glib::translate::*;
use soup_sys;
use std::fmt;
glib_wrapper! {
pub struct AuthDigest(Object<soup_sys::SoupAuthDigest, AuthDigestClass>) @extends Auth;
match fn {
get_type => || soup_sys::soup_auth_digest_get_type(),
}
}
impl AuthDigest {}
impl fmt::Display for AuthDigest {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "AuthDigest")
}
}
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Auth;
use Message;
use SessionFeature;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::translate::*;
use glib_sys;
use soup_sys;
use std::boxed::Box as Box_;
use std::fmt;
use std::mem::transmute;
glib_wrapper! {
pub struct AuthManager(Object<soup_sys::SoupAuthManager, soup_sys::SoupAuthManagerClass, AuthManagerClass>) @implements SessionFeature;
match fn {
get_type => || soup_sys::soup_auth_manager_get_type(),
}
}
pub const NONE_AUTH_MANAGER: Option<&AuthManager> = None;
pub trait AuthManagerExt: 'static {
#[cfg(any(feature = "v2_58", feature = "dox"))]
fn clear_cached_credentials(&self);
//#[cfg(any(feature = "v2_42", feature = "dox"))]
//fn use_auth<P: IsA<Auth>>(&self, uri: /*Ignored*/&mut URI, auth: &P);
fn connect_authenticate<F: Fn(&Self, &Message, &Auth, bool) + 'static>(&self, f: F) -> SignalHandlerId;
}
impl<O: IsA<AuthManager>> AuthManagerExt for O {
#[cfg(any(feature = "v2_58", feature = "dox"))]
fn clear_cached_credentials(&self) {
unsafe {
soup_sys::soup_auth_manager_clear_cached_credentials(self.as_ref().to_glib_none().0);
}
}
//#[cfg(any(feature = "v2_42", feature = "dox"))]
//fn use_auth<P: IsA<Auth>>(&self, uri: /*Ignored*/&mut URI, auth: &P) {
// unsafe { TODO: call soup_sys:soup_auth_manager_use_auth() }
//}
fn connect_authenticate<F: Fn(&Self, &Message, &Auth, bool) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn authenticate_trampoline<P, F: Fn(&P, &Message, &Auth, bool) + 'static>(this: *mut soup_sys::SoupAuthManager, msg: *mut soup_sys::SoupMessage, auth: *mut soup_sys::SoupAuth, retrying: glib_sys::gboolean, f: glib_sys::gpointer)
where P: IsA<AuthManager>
{
let f: &F = &*(f as *const F);
f(&AuthManager::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(msg), &from_glib_borrow(auth), from_glib(retrying))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"authenticate\0".as_ptr() as *const _,
Some(transmute(authenticate_trampoline::<Self, F> as usize)), Box_::into_raw(f))
}
}
}
impl fmt::Display for AuthManager {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "AuthManager")
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment