summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorLibravatar Mubashshir <ahmubashshir@gmail.com>2025-05-19 14:08:11 +0600
committerLibravatar Mubashshir <ahmubashshir@gmail.com>2025-05-19 14:08:11 +0600
commitff1ba1e770b4205c2cc367ff513325e5f22c73e8 (patch)
tree8bef720b23626dc8945d6da9897020766ec61274 /src/main.c
parent815eca3e8f367a6fed50be59b10316b5028773aa (diff)
downloadc-obp-example-ff1ba1e770b4205c2cc367ff513325e5f22c73e8.tar.gz
c-obp-example-ff1ba1e770b4205c2cc367ff513325e5f22c73e8.zip
Code cleanup and reuse
Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index a42b5a6..650cf05 100644
--- a/src/main.c
+++ b/src/main.c
@@ -13,19 +13,19 @@ void process(ref(char) line, unsigned idx, team obj)
unsigned s;
switch(idx) {
case 1:
- set(team, obj, name, line);
+ set(obj, name, line);
break;
case 2:
- set(team, obj, institution, line);
+ set(obj, institution, line);
break;
case 3:
sscanf(line, "%u", &s);
- set(team, obj, solved, s);
+ set(obj, solved, s);
break;
case 4: // falls through
case 5: // falls through
case 6:
- set(team, obj, member_name, idx - 3, line);
+ set(obj, member_name, idx - 3, line);
break;
default:
break;
@@ -56,8 +56,8 @@ int main()
}
}
- team champion = ask(team, find_champion, NULL, teams, num);
- ask(team, printf, champion);
+ team champion = call(dref(teams), find_champion, teams, num);
+ call(champion, printf);
while(num --) del(team, teams[num]);
free(teams);