Advent of Code

Check-in [65953b2da6]
Login

Check-in [65953b2da6]

Overview
Comment:renamed function select to aocselect
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 65953b2da662e69c16262a5797940a682954f37e4ab9196dac88ef09ef8a4c89
User & Date: nnz on 2024-12-02 22:43:07
Other Links: manifest | tags
Context
2024-12-02
22:45
use typedef inside main check-in: e80b4c427f user: nnz tags: trunk
22:43
renamed function select to aocselect check-in: 65953b2da6 user: nnz tags: trunk
22:39
removed unnecessary comment check-in: 81b926f5cf user: nnz tags: trunk
Changes

Modified aoc.c from [3e499c316d] to [10dd7645fa].

34
35
36
37
38
39
40
41
42
43
44
45
        exit(EXIT_FAILURE);
    }
    // read data from dataname into input
    char *input = NULL;
    size_t ilen = slurp(&input, dataname);

    // call the right function
    void (*p)(char *, size_t) = select(y, d);
    if (p) p(input, ilen);
    else fprintf(stderr, "Impossible!\n");
    free(input);
}







|




34
35
36
37
38
39
40
41
42
43
44
45
        exit(EXIT_FAILURE);
    }
    // read data from dataname into input
    char *input = NULL;
    size_t ilen = slurp(&input, dataname);

    // call the right function
    void (*p)(char *, size_t) = aocselect(y, d);
    if (p) p(input, ilen);
    else fprintf(stderr, "Impossible!\n");
    free(input);
}

Modified aocdailies.c from [89d1cc6d94] to [5d832336de].

1
2
3
4
5
6
7
8
9
10
11
#include <stddef.h>
#include "aocdailies.h"

aocfunc *select(int y, int d) {
    aocfunc *p;
    switch (y * 100 + d) {
        default: p = NULL; break;

        #if 0
        case 201501: p = aoc201501; break;
        case 201502: p = aoc201502; break;



|







1
2
3
4
5
6
7
8
9
10
11
#include <stddef.h>
#include "aocdailies.h"

aocfunc *aocselect(int y, int d) {
    aocfunc *p;
    switch (y * 100 + d) {
        default: p = NULL; break;

        #if 0
        case 201501: p = aoc201501; break;
        case 201502: p = aoc201502; break;

Modified aocdailies.h from [c83e1f898d] to [5cec122fbd].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifndef AOCDAILIES_H_INCLUDED
#define AOCDAILIES_H_INCLUDED

#include <stddef.h>

typedef void aocfunc(char *, size_t);
aocfunc *select(int, int);

#if 0
aocfunc aoc201501;
aocfunc aoc201502;
aocfunc aoc201503;
aocfunc aoc201504;
aocfunc aoc201505;






|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifndef AOCDAILIES_H_INCLUDED
#define AOCDAILIES_H_INCLUDED

#include <stddef.h>

typedef void aocfunc(char *, size_t);
aocfunc *aocselect(int, int);

#if 0
aocfunc aoc201501;
aocfunc aoc201502;
aocfunc aoc201503;
aocfunc aoc201504;
aocfunc aoc201505;