lsp-cli 0.1.6

Command-line tool for talking to Language Server Protocol (LSP) servers from the terminal.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "order.h"

double item_total(const OrderItem *item) {
    return item->price * item->quantity;
}

double order_total(const Order *order) {
    double total = 0.0;

    for (size_t index = 0; index < order->item_count; index++) {
        total += item_total(&order->items[index]);
    }

    return total;
}