! Can be used to display API->object info wherever it is called as part of a debug operation. * JUst search for gmtapi_list_objects to see where it is used and how. */
| 822 | /*! Can be used to display API->object info wherever it is called as part of a debug operation. |
| 823 | * JUst search for gmtapi_list_objects to see where it is used and how. */ |
| 824 | GMT_LOCAL void gmtapi_list_objects (struct GMTAPI_CTRL *API, char *txt) { |
| 825 | unsigned int item, ext; |
| 826 | struct GMTAPI_DATA_OBJECT *S; |
| 827 | char message[GMT_LEN256] = {""}, O, M; |
| 828 | /* if (API->deep_debug == false) return; */ |
| 829 | if (!gmt_M_is_verbose (API->GMT, GMT_MSG_DEBUG)) return; |
| 830 | snprintf (message, GMT_LEN256, "==> %d API Objects at end of %s\n", API->n_objects, txt); |
| 831 | GMT_Message (API, GMT_TIME_NONE, message); |
| 832 | if (API->n_objects == 0) return; |
| 833 | GMT_Message (API, GMT_TIME_NONE, "--------------------------------------------------------\n"); |
| 834 | snprintf (message, GMT_LEN256, "K.. ID RESOURCE.... FAMILY.... ACTUAL.... DIR... S O M L\n"); |
| 835 | GMT_Message (API, GMT_TIME_NONE, message); |
| 836 | GMT_Message (API, GMT_TIME_NONE, "--------------------------------------------------------\n"); |
| 837 | for (item = 0; item < API->n_objects; item++) { |
| 838 | if ((S = API->object[item]) == NULL) continue; |
| 839 | O = (S->no_longer_owner) ? 'N' : 'Y'; |
| 840 | M = (S->messenger) ? 'Y' : 'N'; |
| 841 | ext = (S->alloc_mode == GMT_ALLOC_EXTERNALLY) ? '*' : ' '; |
| 842 | snprintf (message, GMT_LEN256, "%c%2d %2d %12" PRIxS " %-10s %-10s %-6s %d %c %c %d\n", ext, item, S->ID, (size_t)S->resource, |
| 843 | GMT_family[S->family], GMT_family[S->actual_family], GMT_direction[S->direction], S->status, O, M, S->alloc_level); |
| 844 | GMT_Message (API, GMT_TIME_NONE, message); |
| 845 | } |
| 846 | GMT_Message (API, GMT_TIME_NONE, "--------------------------------------------------------\n"); |
| 847 | } |
| 848 | |
| 849 | /*! Mostly for debugging */ |
| 850 | GMT_LOCAL void gmtapi_set_object (struct GMTAPI_CTRL *API, struct GMTAPI_DATA_OBJECT *obj) { |
no test coverage detected