Check-in [38b62a8138]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:forgot to make it before committing.. oops
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:38b62a81384286d518864c130a62c665644437458b0b244b52af5324c83203d2
User & Date: grable 2018-11-01 00:56:22
Context
2018-11-01
03:10
reworked unwrap command and added array elements in the process check-in: f5569e7f7a user: grable tags: trunk
00:56
forgot to make it before committing.. oops check-in: 38b62a8138 user: grable tags: trunk
00:54
beginnings of unwrapping arrays, though commented out for now check-in: d013f0e2ff user: grable tags: trunk
Changes

Changes to jimff-commands.c.

505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
...
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
...
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
...
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
	Jim_Obj* list;
	int index;
	int count;
	char* end;
	void* p;
	char tag;
	
	if(argc >= 1 && Jim_StringCompareImmediate( interp, argv[1], "-packed")) {
		packed = 1;
		argv++;
		argc--;
	}
	
	if(argc < 3) {
wrongnumargs:
................................................................................

#define struct_ptr(t)		((t*)(ptr + offs))
#define struct_elem(t)	({ t _val = *struct_ptr(t); offs += sizeof(t); _val; })
#define GET_ELEM(v)		({ if(list) Jim_ListAppendElement( interp, list, (v));								\
										else { Jim_SetVariable( interp, argv[index++], (v)); index++; } })
	
	offs = 0;
	
	for( const char* t = typetag; ;;) {
		switch(*t) {
			case '\0':	goto done;
			case 'v':	goto err_invalid_typetag;
			case 'c':	tag = *t; GET_ELEM( Jim_NewIntObj( interp, struct_elem(signed char))); break;
			case 'b':
			case 'C':	tag = *t; GET_ELEM( Jim_NewIntObj( interp, struct_elem(unsigned char))); break;
			case 's':	tag = *t; GET_ELEM( Jim_NewIntObj( interp, struct_elem(signed short))); break;
................................................................................
							goto err_structs_unsupported;
					}
				}
				break; */
			
			default:	goto err_invalid_typetag;
		}
		i++;
	}	
done:
	if(list) Jim_SetResult( interp, list);
	else Jim_SetResultInt( interp, index - 3);
	return JIM_OK;
		
err_not_pointer:
................................................................................
	int offs;
	Jim_Obj* list;
	int index;
	union jimff_result tmp;
	int sz;
	void* p;
	
	if(argc >= 1 && Jim_StringCompareImmediate( interp, argv[1], "-packed")) {
		packed = 1;
		argv++;
		argc--;
	}	
	
	if(argc < 4) {
wrongnumargs:







|







 







<
|







 







|







 







|







505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
...
537
538
539
540
541
542
543

544
545
546
547
548
549
550
551
...
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
...
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
	Jim_Obj* list;
	int index;
	int count;
	char* end;
	void* p;
	char tag;
	
	if(argc >= 1 && Jim_CompareStringImmediate( interp, argv[1], "-packed")) {
		packed = 1;
		argv++;
		argc--;
	}
	
	if(argc < 3) {
wrongnumargs:
................................................................................

#define struct_ptr(t)		((t*)(ptr + offs))
#define struct_elem(t)	({ t _val = *struct_ptr(t); offs += sizeof(t); _val; })
#define GET_ELEM(v)		({ if(list) Jim_ListAppendElement( interp, list, (v));								\
										else { Jim_SetVariable( interp, argv[index++], (v)); index++; } })
	
	offs = 0;

	for( const char* t = typetag; ;) {
		switch(*t) {
			case '\0':	goto done;
			case 'v':	goto err_invalid_typetag;
			case 'c':	tag = *t; GET_ELEM( Jim_NewIntObj( interp, struct_elem(signed char))); break;
			case 'b':
			case 'C':	tag = *t; GET_ELEM( Jim_NewIntObj( interp, struct_elem(unsigned char))); break;
			case 's':	tag = *t; GET_ELEM( Jim_NewIntObj( interp, struct_elem(signed short))); break;
................................................................................
							goto err_structs_unsupported;
					}
				}
				break; */
			
			default:	goto err_invalid_typetag;
		}
		t++;
	}	
done:
	if(list) Jim_SetResult( interp, list);
	else Jim_SetResultInt( interp, index - 3);
	return JIM_OK;
		
err_not_pointer:
................................................................................
	int offs;
	Jim_Obj* list;
	int index;
	union jimff_result tmp;
	int sz;
	void* p;
	
	if(argc >= 1 && Jim_CompareStringImmediate( interp, argv[1], "-packed")) {
		packed = 1;
		argv++;
		argc--;
	}	
	
	if(argc < 4) {
wrongnumargs: