Skip to content
Extraits de code Groupes Projets
Sélectionner une révision Git
  • 41339349e0bd220f0eccc7bd74ead980f634ba57
  • 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

write.c

Blame
  • write.c 9,63 Kio
    #define _POSIX_C_SOURCE 200809L
    #define _DEFAULT_SOURCE
    
    #include <lektor/mkv.h>
    #include <pcre.h>
    #include <stdbool.h>
    #include <stdio.h>
    #include <unistd.h>
    #include <limits.h>
    #include <dirent.h>
    #include <string.h>
    #include <stdlib.h>
    #include <errno.h>
    #include <fcntl.h>
    #include <sys/stat.h>
    #include <sys/wait.h>
    
    static const char *METADATA_TEMPLATE =
        "   <?xml version=\"1.0\" encoding=\"UTF-8\"?>  "
        "   <Tags>                                      "
        "   <Tag>                                       "
        "     <Targets>                                 "
        "       <TargetTypeValue>70</TargetTypeValue>   "
        "     </Targets>                                "
        "     <Simple>                                  "
        "       <Name>TITLE</Name>                      "
        "       <String>%s</String>                     "
        "     </Simple>                                 "
        "   </Tag>                                      "
        "   <Tag>                                       "
        "     <Simple>                                  "
        "       <Name>TITLE</Name>                      "
        "       <String>%s</String>                     "
        "     </Simple>                                 "
        "     <Simple>                                  "
        "       <Name>CONTENT_TYPE</Name>               "
        "       <String>%s</String>                     "
        "     </Simple>                                 "
        "     <Simple>                                  "
        "       <Name>ADDRESS</Name>                    "
        "       <String>%s</String>                     "
        "     </Simple>                                 "
        "     <Simple>                                  "
        "       <Name>ARTIST</Name>                     "
        "       <String>%s</String>                     "
        "     </Simple>                                 "
        "     <Simple>                                  "
        "       <Name>GENRE</Name>                      "
        "       <String>%s</String>                     "
        "     </Simple>                                 "
        "     <Simple>                                  "
        "       <Name>TRACK</Name>                      "
        "       <String>%d</String>                     "
        "     </Simple>                                 "
        "   </Tag>                                      "
        "   </Tags>                                     ";
    
    static bool
    mkvpropedit__(const char *const args[])
    {
        pid_t pid;
        int wstatus, status, fd;
    
        if ((pid = fork()) == 0) {
            if ((fd = open("/dev/null", O_WRONLY | O_TRUNC)) < 0) {
                fprintf(stderr, " ! call_mkvpropedit: can't to open /dev/null in O_WRONLY O_TRUNC\n");
                return false;
            }
    
            if (dup2(fd, 1) < 0) {