/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ /* Copyright 2013-2021 The Libfossil Authors, see LICENSES/BSD-2-Clause.txt SPDX-License-Identifier: BSD-2-Clause-FreeBSD SPDX-FileCopyrightText: 2021 The Libfossil Authors SPDX-ArtifactOfProjectName: Libfossil SPDX-FileType: Code */ /** This is a template application for libfossil fcli client apps, with commentary explaining how to do various common things with the API. Copy/paste this and modify it to suit. */ #include "fossil-scm/fossil-cli.h" #include "fossil-scm/fossil-internal.h" // Only for testing/debugging.. #define MARKER(pfexp) \ do{ printf("MARKER: %s:%d:%s():\t",__FILE__,__LINE__,__func__); \ printf pfexp; \ } while(0) // Global app state. struct App_ { char const * lineLHS; char const * lineRHS; } App = { NULL,//lineLHS NULL//lineRHS }; static int app_stuff(void){ fsl_dline a = fsl_dline_empty; fsl_dline b = fsl_dline_empty; fsl_dline_change chng = fsl_dline_change_empty; int i, j, x; a.z = App.lineLHS; a.n = (int)fsl_strlen(a.z); b.z = App.lineRHS; b.n = (int)fsl_strlen(b.z); fsl_dline_change_spans(&a, &b, &chng); f_out("left: [%s]\n", a.z); for(i=x=0; i x ){ if( (a.z[x]&0xc0)!=0x80 ) f_out(" "); x++; } for(j=0; j x ){ if( (b.z[x]&0xc0)!=0x80 ) f_out(" "); x++; } for(j=0; j