History

C/ML consistency/harmony

malc committed 5 years ago

Commit ae32b781 parent c4dbeda1 file · +19 −19Browse files

Unified · Split

link.c+19−19
@@ -52,10 +52,10 @@ enum { · 51 unmodified lines
52 Cpage, Ctile, Ctrimset, Csettrim, Csliceh, Cinterrupt52 Cpage, Ctile, Ctrimset, Csettrim, Csliceh, Cinterrupt
53};53};
54enum { FitWidth, FitProportional, FitPage };54enum { FitWidth, FitProportional, FitPage };
55enum { dir_first, dir_last };55enum { LDfirst, LDlast };
56enum { dir_first_visible, dir_left, dir_right, dir_down, dir_up };56enum { LDfirstvisible, LDleft, LDright, LDdown, LDup };
57enum { uuri, utext, utextannot, ufileannot, unone };57enum { Uuri, Utext, Utextannot, Ufileannot, Unone };
58enum { mark_page, mark_block, mark_line, mark_word };58enum { Mark_page, Mark_block, Mark_line, Mark_word };
59 59
60struct slice {60struct slice {
61 int h;61 int h;
@@ -2330,7 +2330,7 @@ ML (findlink (value ptr_v, value dir_v)) · 2268 unmodified lines
2330 if (Is_block (dir_v)) {2330 if (Is_block (dir_v)) {
2331 dirtag = Tag_val (dir_v);2331 dirtag = Tag_val (dir_v);
2332 switch (dirtag) {2332 switch (dirtag) {
2333 case dir_first_visible:2333 case LDfirstvisible:
2334 {2334 {
2335 int x0, y0, dir, first_index, last_index;2335 int x0, y0, dir, first_index, last_index;
2336 2336
@@ -2359,7 +2359,7 @@ ML (findlink (value ptr_v, value dir_v)) · 22 unmodified lines
2359 }2359 }
2360 break;2360 break;
2361 2361
2362 case dir_left:2362 case LDleft:
2363 slinkindex = Int_val (Field (dir_v, 0));2363 slinkindex = Int_val (Field (dir_v, 0));
2364 found = &page->slinks[slinkindex];2364 found = &page->slinks[slinkindex];
2365 for (i = slinkindex - 1; i >= 0; --i) {2365 for (i = slinkindex - 1; i >= 0; --i) {
@@ -2371,7 +2371,7 @@ ML (findlink (value ptr_v, value dir_v)) · 5 unmodified lines
2371 }2371 }
2372 break;2372 break;
2373 2373
2374 case dir_right:2374 case LDright:
2375 slinkindex = Int_val (Field (dir_v, 0));2375 slinkindex = Int_val (Field (dir_v, 0));
2376 found = &page->slinks[slinkindex];2376 found = &page->slinks[slinkindex];
2377 for (i = slinkindex + 1; i < page->slinkcount; ++i) {2377 for (i = slinkindex + 1; i < page->slinkcount; ++i) {
@@ -2383,7 +2383,7 @@ ML (findlink (value ptr_v, value dir_v)) · 5 unmodified lines
2383 }2383 }
2384 break;2384 break;
2385 2385
2386 case dir_down:2386 case LDdown:
2387 slinkindex = Int_val (Field (dir_v, 0));2387 slinkindex = Int_val (Field (dir_v, 0));
2388 found = &page->slinks[slinkindex];2388 found = &page->slinks[slinkindex];
2389 for (i = slinkindex + 1; i < page->slinkcount; ++i) {2389 for (i = slinkindex + 1; i < page->slinkcount; ++i) {
@@ -2395,7 +2395,7 @@ ML (findlink (value ptr_v, value dir_v)) · 5 unmodified lines
2395 }2395 }
2396 break;2396 break;
2397 2397
2398 case dir_up:2398 case LDup:
2399 slinkindex = Int_val (Field (dir_v, 0));2399 slinkindex = Int_val (Field (dir_v, 0));
2400 found = &page->slinks[slinkindex];2400 found = &page->slinks[slinkindex];
2401 for (i = slinkindex - 1; i >= 0; --i) {2401 for (i = slinkindex - 1; i >= 0; --i) {
@@ -2411,11 +2411,11 @@ ML (findlink (value ptr_v, value dir_v)) · 9 unmodified lines
2411 else {2411 else {
2412 dirtag = Int_val (dir_v);2412 dirtag = Int_val (dir_v);
2413 switch (dirtag) {2413 switch (dirtag) {
2414 case dir_first:2414 case LDfirst:
2415 found = page->slinks;2415 found = page->slinks;
2416 break;2416 break;
2417 2417
2418 case dir_last:2418 case LDlast:
2419 if (page->slinks) {2419 if (page->slinks) {
2420 found = page->slinks + (page->slinkcount - 1);2420 found = page->slinks + (page->slinkcount - 1);
2421 }2421 }
@@ -2450,12 +2450,12 @@ ML (getlink (value ptr_v, value n_v)) · 28 unmodified lines
2450 if (slink->tag == SLINK) {2450 if (slink->tag == SLINK) {
2451 link = slink->u.link;2451 link = slink->u.link;
2452 str_v = caml_copy_string (link->uri);2452 str_v = caml_copy_string (link->uri);
2453 ret_v = caml_alloc_small (1, uuri);2453 ret_v = caml_alloc_small (1, Uuri);
2454 Field (ret_v, 0) = str_v;2454 Field (ret_v, 0) = str_v;
2455 }2455 }
2456 else {2456 else {
2457 int ty = pdf_annot_type (state.ctx, slink->u.annot)2457 int ty = pdf_annot_type (state.ctx, slink->u.annot)
2458 == PDF_ANNOT_FILE_ATTACHMENT ? ufileannot : utextannot;2458 == PDF_ANNOT_FILE_ATTACHMENT ? Ufileannot : Utextannot;
2459 2459
2460 ret_v = caml_alloc_small (1, ty);2460 ret_v = caml_alloc_small (1, ty);
2461 tup_v = caml_alloc_tuple (2);2461 tup_v = caml_alloc_tuple (2);
@@ -2615,7 +2615,7 @@ ML (whatsunder (value ptr_v, value x_v, value y_v)) · 153 unmodified lines
2615 }2615 }
2616 }2616 }
2617 ty = pdf_annot_type (state.ctx, annot->annot)2617 ty = pdf_annot_type (state.ctx, annot->annot)
2618 == PDF_ANNOT_FILE_ATTACHMENT ? ufileannot : utextannot;2618 == PDF_ANNOT_FILE_ATTACHMENT ? Ufileannot : Utextannot;
2619 2619
2620 ret_v = caml_alloc_small (1, ty);2620 ret_v = caml_alloc_small (1, ty);
2621 tup_v = caml_alloc_tuple (2);2621 tup_v = caml_alloc_tuple (2);
@@ -2628,7 +2628,7 @@ ML (whatsunder (value ptr_v, value x_v, value y_v)) · 6 unmodified lines
2628 link = getlink (page, x, y);2628 link = getlink (page, x, y);
2629 if (link) {2629 if (link) {
2630 str_v = caml_copy_string (link->uri);2630 str_v = caml_copy_string (link->uri);
2631 ret_v = caml_alloc_small (1, uuri);2631 ret_v = caml_alloc_small (1, Uuri);
2632 Field (ret_v, 0) = str_v;2632 Field (ret_v, 0) = str_v;
2633 }2633 }
2634 else {2634 else {
@@ -2684,7 +2684,7 @@ ML (whatsunder (value ptr_v, value x_v, value y_v)) · 49 unmodified lines
2684 if (str_v == Val_unit) {2684 if (str_v == Val_unit) {
2685 str_v = caml_copy_string (n2);2685 str_v = caml_copy_string (n2);
2686 }2686 }
2687 ret_v = caml_alloc_small (1, utext);2687 ret_v = caml_alloc_small (1, Utext);
2688 Field (ret_v, 0) = str_v;2688 Field (ret_v, 0) = str_v;
2689 goto unlock;2689 goto unlock;
2690 }2690 }
@@ -2743,7 +2743,7 @@ ML (markunder (value ptr_v, value x_v, value y_v, value mark_v)) · 52 unmodified lines
2743 2743
2744 ensuretext (page);2744 ensuretext (page);
2745 2745
2746 if (mark == mark_page) {2746 if (mark == Mark_page) {
2747 page->fmark = page->text->first_block->u.t.first_line->first_char;2747 page->fmark = page->text->first_block->u.t.first_line->first_char;
2748 page->lmark = page->text->last_block->u.t.last_line->last_char;2748 page->lmark = page->text->last_block->u.t.last_line->last_char;
2749 ret_v = Val_bool (1);2749 ret_v = Val_bool (1);
@@ -2761,7 +2761,7 @@ ML (markunder (value ptr_v, value x_v, value y_v, value mark_v)) · 11 unmodified lines
2761 continue;2761 continue;
2762 }2762 }
2763 2763
2764 if (mark == mark_block) {2764 if (mark == Mark_block) {
2765 page->fmark = block->u.t.first_line->first_char;2765 page->fmark = block->u.t.first_line->first_char;
2766 page->lmark = block->u.t.last_line->last_char;2766 page->lmark = block->u.t.last_line->last_char;
2767 ret_v = Val_bool (1);2767 ret_v = Val_bool (1);
@@ -2775,7 +2775,7 @@ ML (markunder (value ptr_v, value x_v, value y_v, value mark_v)) · 7 unmodified lines
2775 continue;2775 continue;
2776 }2776 }
2777 2777
2778 if (mark == mark_line) {2778 if (mark == Mark_line) {
2779 page->fmark = line->first_char;2779 page->fmark = line->first_char;
2780 page->lmark = line->last_char;2780 page->lmark = line->last_char;
2781 ret_v = Val_bool (1);2781 ret_v = Val_bool (1);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t