~ubuntu-branches/ubuntu/breezy/links/breezy

« back to all changes in this revision

Viewing changes to types.c

  • Committer: Bazaar Package Importer
  • Author(s): Peter Gervai
  • Date: 2004-11-22 14:07:14 UTC
  • mfrom: (0.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041122140714-67z5u53cd7weqy1t
Tags: 0.99+1.00pre12-1
* New upstream version 1.00pre12 (closes: #240059).
* Fix xterm garbling (closes: #266803)

Show diffs side-by-side

added added

removed removed

Lines of Context:
198
198
                return;
199
199
        }
200
200
        new->cnt = get_assoc_cnt();
201
 
        if (!(repl = mem_alloc(sizeof(struct assoc)))) return;
 
201
        repl = mem_alloc(sizeof(struct assoc));
202
202
        add_to_list(assoc, repl);
203
203
        replace:
204
204
        repl->label = stracpy(new->label);
214
214
 
215
215
void really_del_ct(void *fcp)
216
216
{
217
 
        int fc = (int)fcp;
 
217
        tcount fc = (int)fcp;
218
218
        struct assoc *del;
219
219
        foreach(del, assoc) if (del->cnt == fc) goto ok;
220
220
        return;
226
226
{
227
227
        unsigned char *str;
228
228
        int l;
229
 
        int fc = (int)fcp;
 
229
        tcount fc = (int)fcp;
230
230
        struct assoc *del;
231
231
        foreach(del, assoc) if (del->cnt == fc) goto ok;
232
232
        return;
241
241
void menu_add_ct(struct terminal *term, void *fcp, void *xxx2)
242
242
{
243
243
        int p;
244
 
        int fc = (int)fcp;
 
244
        tcount fc = (int)fcp;
245
245
        struct assoc *new, *from;
246
246
        unsigned char *label;
247
247
        unsigned char *ct;
253
253
        }
254
254
        from = NULL;
255
255
        ok:
256
 
        if (!(d = mem_alloc(sizeof(struct dialog) + 10 * sizeof(struct dialog_item) + sizeof(struct assoc) + 3 * MAX_STR_LEN))) return;
 
256
        d = mem_alloc(sizeof(struct dialog) + 10 * sizeof(struct dialog_item) + sizeof(struct assoc) + 3 * MAX_STR_LEN);
257
257
        memset(d, 0, sizeof(struct dialog) + 10 * sizeof(struct dialog_item) + sizeof(struct assoc) + 3 * MAX_STR_LEN);
258
258
        new = (struct assoc *)&d->items[10];
259
259
        new->label = label = (unsigned char *)(new + 1);
320
320
}
321
321
 
322
322
struct menu_item mi_no_assoc[] = {
323
 
        TEXT(T_NO_ASSOCIATIONS), "", M_BAR, NULL, NULL, 0, 0,
324
 
        NULL, NULL, 0, NULL, NULL, 0, 0
 
323
        { TEXT(T_NO_ASSOCIATIONS), "", M_BAR, NULL, NULL, 0, 0 },
 
324
        { NULL, NULL, 0, NULL, NULL, 0, 0 },
325
325
};
326
326
 
327
327
void menu_list_assoc(struct terminal *term, void *fn, void *xxx)
398
398
                return;
399
399
        }
400
400
        new->cnt = get_assoc_cnt();
401
 
        if (!(repl = mem_alloc(sizeof(struct extension)))) return;
 
401
        repl = mem_alloc(sizeof(struct extension));
402
402
        add_to_list(extensions, repl);
403
403
        replace:
404
404
        repl->ext = stracpy(new->ext);
408
408
 
409
409
void really_del_ext(void *fcp)
410
410
{
411
 
        int fc = (int)fcp;
 
411
        tcount fc = (int)fcp;
412
412
        struct extension *del;
413
413
        foreach(del, extensions) if (del->cnt == fc) goto ok;
414
414
        return;
420
420
{
421
421
        unsigned char *str;
422
422
        int l;
423
 
        int fc = (int)fcp;
 
423
        tcount fc = (int)fcp;
424
424
        struct extension *del;
425
425
        foreach(del, extensions) if (del->cnt == fc) goto ok;
426
426
        return;
434
434
 
435
435
void menu_add_ext(struct terminal *term, void *fcp, void *xxx2)
436
436
{
437
 
        int fc = (int)fcp;
 
437
        tcount fc = (int)fcp;
438
438
        struct extension *new, *from;
439
439
        unsigned char *ext;
440
440
        unsigned char *ct;
445
445
        }
446
446
        from = NULL;
447
447
        ok:
448
 
        if (!(d = mem_alloc(sizeof(struct dialog) + 5 * sizeof(struct dialog_item) + sizeof(struct extension) + 2 * MAX_STR_LEN))) return;
 
448
        d = mem_alloc(sizeof(struct dialog) + 5 * sizeof(struct dialog_item) + sizeof(struct extension) + 2 * MAX_STR_LEN);
449
449
        memset(d, 0, sizeof(struct dialog) + 5 * sizeof(struct dialog_item) + sizeof(struct extension) + 2 * MAX_STR_LEN);
450
450
        new = (struct extension *)&d->items[5];
451
451
        new->ext = ext = (unsigned char *)(new + 1);
480
480
}
481
481
 
482
482
struct menu_item mi_no_ext[] = {
483
 
        TEXT(T_NO_EXTENSIONS), "", M_BAR, NULL, NULL, 0, 0,
484
 
        NULL, NULL, 0, NULL, NULL, 0, 0
 
483
        { TEXT(T_NO_EXTENSIONS), "", M_BAR, NULL, NULL, 0, 0 },
 
484
        { NULL, NULL, 0, NULL, NULL, 0, 0 },
485
485
};
486
486
 
487
487
void menu_list_ext(struct terminal *term, void *fn, void *xxx)
504
504
                mem_free(repl->prog);
505
505
                goto ss;
506
506
        }
507
 
        if (!(repl = mem_alloc(sizeof(struct protocol_program)))) return;
 
507
        repl = mem_alloc(sizeof(struct protocol_program));
508
508
        add_to_list(*l, repl);
509
509
        repl->system = s;
510
510
        ss:
511
 
        if ((repl->prog = mem_alloc(MAX_STR_LEN))) {
512
 
                strncpy(repl->prog, p, MAX_STR_LEN);
513
 
                repl->prog[MAX_STR_LEN - 1] = 0;
514
 
        }
 
511
        repl->prog = mem_alloc(MAX_STR_LEN);
 
512
        strncpy(repl->prog, p, MAX_STR_LEN);
 
513
        repl->prog[MAX_STR_LEN - 1] = 0;
515
514
}
516
515
 
517
516
unsigned char *get_prog(struct list_head *l)