diff options
| author | Mattias Andrée <m@maandree.se> | 2026-02-22 14:58:29 +0100 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2026-02-22 14:58:29 +0100 |
| commit | 9a986ce26fc80117c2e2c0a57fcf4209cd0e243c (patch) | |
| tree | ca65251dea834a5bd45d1cac93cb598dacf165c0 | |
| parent | Add missing @since (diff) | |
| download | libgeome-9a986ce26fc80117c2e2c0a57fcf4209cd0e243c.tar.gz libgeome-9a986ce26fc80117c2e2c0a57fcf4209cd0e243c.tar.bz2 libgeome-9a986ce26fc80117c2e2c0a57fcf4209cd0e243c.tar.xz | |
Signed-off-by: Mattias Andrée <m@maandree.se>
| -rw-r--r-- | README | 24 | ||||
| -rw-r--r-- | libgeome.h | 26 |
2 files changed, 25 insertions, 25 deletions
@@ -53,20 +53,20 @@ SYNOPSIS int libgeome_get_from_netservice(struct libgeome_context *, struct libgeome_data *, const struct libgeome_netservice *); - /* less fundament features omitted */ + /* less fundamental features omitted */ Link with -lgeome -lm. DESCRIPTION - libgeome is a library which provides functionally for looking up - the local user's location on the Globe. + libgeome is a library which provides functionality for looking up + the local user's location on the globe. To use libgeome, first create and initialise a struct libgeome_context which will be used for all other library calls. This can easily be done - by creating a statically allocated struct libgeome_context and call the + by creating a statically allocated struct libgeome_context and calling the libgeome_basic_context(3) function with it as the first argument and the name of the program as the second argument, optionally with - "libgeome" added make it clear where error messages are printed from. + "libgeome" added to make it clear where error messages are printed from. libgeome_get_from_file(3) can be used to check if the user has specified his location in /etc/geolocation (use NULL as the third argument) or any @@ -74,8 +74,8 @@ DESCRIPTION The next best thing is to use libgeome_get_from_timezone(3) to get a rough location based on the user's timezone. But if this doesn't work, - libgeome_get_from_time(3) must be used, which provides only gives an - approximate longitude based one the current timezone, which is affected + libgeome_get_from_time(3) must be used, which only provides an + approximate longitude based on the current timezone, which is affected by daylight saving, which may be desirable for some applications but not for other applications. @@ -86,16 +86,16 @@ DESCRIPTION The function libgeome_get_from_netservice(3) is used for this, and a list of services is provided in libgeome_netservices(3), with the number of services listed provided in libgeome_netservices_count(3). You can - also add custom services, or run local program, using the + also add custom services, or run a local program, using the libgeome_get_from_command(3) function. If it cannot parse the output, - can reformat it as "%s %s\n", <latitude>, <longitude>. + you can reformat it as "%s %s\n", <latitude>, <longitude>. - When alling a libgeome function, any struct libgeome_data must have + When calling a libgeome function, any struct libgeome_data must have its .requested_data set. This lets the called function 1) know what data to request, and 2) what fields are available in the application's version of the structure so that it doesn't write outside it if it is - out of date. There for it is critical that the application doesn't - simply set all but, but instead only recognised ones. + out of date. Therefore it is critical that the application does not + simply set all bits, but instead only the recognised ones. EXTENDED DESCRIPTION Runtime-optional dependencies @@ -76,9 +76,9 @@ enum libgeome_portability { LIBGEOME_PORTABLE, /** - * The user hsa specified that the is often + * The user has specified that the machine is often * on the move when in use and that it is - * useful to keep the locations updated with + * useful to keep the location updated with * short intervals */ LIBGEOME_MOBILE @@ -258,7 +258,7 @@ extern const char *const libgeome_default_geolocation_file; /** - * Create a basic initialisation for `struct libgeome_context` + * Create a basic initialisation of `struct libgeome_context` * * Note that the implementation will use `ctx_out->user_data` to store `procname` * there. It will not make a copy of `procname`, so `procname` must be valid while @@ -272,13 +272,13 @@ extern const char *const libgeome_default_geolocation_file; * @param ctx_out Structure to initialise * @param procname The name of the process, will be prefixed to all outputs * using the format `"%s: ", procname`. It may be a good idea - * to add prepend ": libgeome: " to make it clear that the + * to prepend ": libgeome: " to make it clear that the * output comes from libgeome */ void libgeome_basic_context(struct libgeome_context *ctx_out, const char *procname); /** - * Get the machine's partability class + * Get the machine's portability class * * @param ctx Library context * @param out Output parameter @@ -341,7 +341,7 @@ int libgeome_get_from_timezone(struct libgeome_context *ctx, struct libgeome_dat int libgeome_get_from_file(struct libgeome_context *ctx, struct libgeome_data *out, const char *path); /** - * Spawn a program and read it's standard output + * Spawn a program and read its standard output * to get the user's location data * * @param ctx Library context @@ -357,26 +357,26 @@ int libgeome_get_from_command(struct libgeome_context *ctx, struct libgeome_data unsigned int alarm_sec, const char *path, const char *const *argv); /** - * Spawn a program and read it's standard output + * Spawn a program and read its standard output * to get the user's location data * * `path` and elements of `argv` are subject to %-substitution * using the following rules: * * - The string is parsed from left to right - * - Any '%' trigger substitutation + * - Any '%' triggers substitution * - If the next character is not '%', the "%%" is replaced with a literal "%" - * - Otherwise the next character character must be '{' and '%' marks the beginning + * - Otherwise the next character must be '{' and '%' marks the beginning * of a %-pattern. * - Within a %-pattern "%%" is replaced with "%" and "%}" with "}", and no other * use of "%" is invalid (nested patterns are disallowed). - * - A %-pattern ends with the first other occurance of a '}' + * - A %-pattern ends with the next occurrence of a '}' * - Each %-pattern shall be on one of the two forms: * - "%%{%u:%s}", <feature set>, <text> * - "%%{!%u:%s}", <feature set>, <text> - * The if the first pattern is used the pattern is deleted and only replaced with + * If the first pattern is used the pattern is deleted and only replaced with * <text> if `out->requested_data & <feature set>` is non-zero. - * The if the second pattern is used the pattern is deleted and only replaced with + * If the second pattern is used the pattern is deleted and only replaced with * <text> if `out->requested_data & <feature set>` is zero. * <feature set> must be positive. * @@ -395,7 +395,7 @@ int libgeome_get_from_patterned_command(struct libgeome_context *ctx, struct lib unsigned int alarm_sec, const char *path, const char *const *argv); /** - * Spawn a program and read it's standard output + * Spawn a program and read its standard output * to get the user's location data * * @param ctx Library context |
