Lichen

Change of templates/ops.h

900:c7eaa76e5b0f
templates/ops.h temporary-object-experiment
     1.1 --- a/templates/ops.h	Mon Feb 04 18:53:56 2019 +0100
     1.2 +++ b/templates/ops.h	Mon May 20 13:12:25 2019 +0200
     1.3 @@ -1,6 +1,6 @@
     1.4  /* Common operations.
     1.5  
     1.6 -Copyright (C) 2015, 2016, 2017, 2018 Paul Boddie <paul@boddie.org.uk>
     1.7 +Copyright (C) 2015, 2016, 2017, 2018, 2019 Paul Boddie <paul@boddie.org.uk>
     1.8  
     1.9  This program is free software; you can redistribute it and/or modify it under
    1.10  the terms of the GNU General Public License as published by the Free Software
    1.11 @@ -42,8 +42,18 @@
    1.12  #define __load_via_object(OBJ, ATTRNAME) (__load_via_object__(OBJ, __ATTRPOS(ATTRNAME)))
    1.13  #define __get_class_and_load(OBJ, ATTRNAME) (__get_class_and_load__(OBJ, __ATTRPOS(ATTRNAME)))
    1.14  
    1.15 +/* Object state updating when assigning. */
    1.16 +
    1.17 +__attr __store_attr__(__attr value);
    1.18 +
    1.19  /* Direct storage operations. */
    1.20  
    1.21 +int __store_member__(__ref obj, int pos, __attr value);
    1.22 +
    1.23 +#define __store_local(NAME, VALUE) (NAME = __store_attr__(VALUE))
    1.24 +/* #define __store_local(NAME, VALUE) (NAME = VALUE) */
    1.25 +#define __store_member(OBJ, ATTRNAME, VALUE) (__store_member__(OBJ, __ATTRPOS(ATTRNAME), VALUE))
    1.26 +
    1.27  int __store_via_class__(__ref obj, int pos, __attr value);
    1.28  int __store_via_object__(__ref obj, int pos, __attr value);
    1.29  int __get_class_and_store__(__ref obj, int pos, __attr value);