[core] API: compiling Seam 1 skeleton (types, signatures, stubs)
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
||||
//! Steam: `config/libraryfolders.vdf` lists the library folders; each installed app has
|
||||
//! `<library>/steamapps/appmanifest_<id>.acf`. Launch is `steam://rungameid/<id>`.
|
||||
|
||||
use crate::error::ParseError;
|
||||
use crate::model::Game;
|
||||
use crate::path::WinPath;
|
||||
|
||||
/// The library folders listed in `libraryfolders.vdf` (both the current layout, `"0" { "path" "..." }`, and the
|
||||
/// old one, `"1" "D:\\SteamLibrary"`). At most [`crate::limits::MAX_LIBRARIES`]; a path listed twice is refused.
|
||||
pub fn library_folders(vdf: &[u8]) -> Result<Vec<WinPath>, ParseError> {
|
||||
let _ = vdf;
|
||||
Err(ParseError::Syntax { at: 0 })
|
||||
}
|
||||
|
||||
/// The game described by `appmanifest_<id>.acf` inside `library` (the folder holding `steamapps`). The install
|
||||
/// folder is `<library>\steamapps\common\<installdir>`, where `installdir` must be one plain folder name.
|
||||
/// Steam's own redistributables and runtimes ([`is_tool`]) give [`ParseError::NotAGame`].
|
||||
pub fn app_manifest(acf: &[u8], library: &WinPath) -> Result<Game, ParseError> {
|
||||
let _ = (acf, library);
|
||||
Err(ParseError::Syntax { at: 0 })
|
||||
}
|
||||
|
||||
/// The app id in a file name `appmanifest_<id>.acf` (exact, lowercase, canonical id), for filtering a folder
|
||||
/// listing; `None` for any other name.
|
||||
pub fn app_id_from_manifest_name(name: &str) -> Option<u32> {
|
||||
let _ = name;
|
||||
None
|
||||
}
|
||||
|
||||
/// Steam apps that are not games: the common redistributables and the Linux runtimes.
|
||||
pub fn is_tool(app_id: u32) -> bool {
|
||||
let _ = app_id;
|
||||
false
|
||||
}
|
||||
Reference in New Issue
Block a user