Skip to content
Extraits de code Groupes Projets
Sélectionner une révision Git
  • 952585de3657267dd5d336e182def91b3c20fe10
  • master par défaut protégée
  • rust-playlist-sync
  • rust
  • fix-qt-deprecated-qvariant-type
  • fix-mpris-qtwindow-race-condition
  • rust-appimage-wayland
  • windows-build-rebased
  • v2.5 protégée
  • v2.4 protégée
  • v2.3-1 protégée
  • v2.3 protégée
  • v2.2 protégée
  • v2.1 protégée
  • v2.0 protégée
  • v1.8-3 protégée
  • v1.8-2 protégée
  • v1.8-1 protégée
  • v1.8 protégée
  • v1.7 protégée
  • v1.6 protégée
  • v1.5 protégée
  • v1.4 protégée
  • v1.3 protégée
  • v1.2 protégée
  • v1.1 protégée
  • v1.0 protégée
27 résultats

common.h

Blame
  • common.h 1,23 Kio
    #pragma once
    
    #include <common/macro.h>
    #include <unistd.h>
    #include <stdint.h>
    
    #define not_implemented() __not_implemented(__func__,__FILE__,__LINE__)
    extern void __not_implemented(const char *func, char *file, int line);
    
    #define UNUSED(...) __unused((void *) __VA_ARGS__)
    void __unused(void *, ...);
    
    long get_mtime(const char *path);
    
    void *safe_malloc(size_t size);
    
    int is_utf8(const char *string);
    
    /* Read `bytes` as the big endian representation of a 32-bit unsigned integer.
       `n` is the number of bytes in `bytes`
       Returns 0 if n is 0.
       Restriction: n <= 4 */
    uint32_t be_uint32_t(const uint8_t bytes[], size_t n);
    
    /* Same as `be_uint32_t` but for 64-bit unsigned integers.
       Restriction: n <= 8 */
    uint64_t be_uint64_t(const uint8_t bytes[], size_t n);
    
    /* Trim the string `str` of the char `c` from the right and the left.
       The string may not be null terminated.
       Returns a pointer to the the trimmed string
       Restrictions: the len of the string must be `len`. */
    char *trim(char *str, size_t len, char c);
    
    /* Get a line from stdin safely. */
    int get_stdin_line(const char *prompt, char *buf, size_t len);
    
    int read_self_exe(char *path, size_t len);
    
    int safe_snprintf(char *dest, const size_t max_len, const char *format, ...);