Skip to content
Snippets Groups Projects
Select Git revision
  • 44f622c69e1a8386f8dd66b63bb5b07c55b00f9f
  • master default protected
  • hierarchical-basis
  • alphashapes
  • bl
  • relaying
  • new_export_boris
  • oras_vs_osm
  • reassign_partitions
  • distributed_fwi
  • rename-classes
  • fix/fortran-api-example-t4
  • robust_partitions
  • reducing_files
  • fix_overlaps
  • 3115-issue-fix
  • 3023-Fillet2D-Update
  • convert_fdivs
  • tmp_jcjc24
  • fixedMeshIF
  • save_edges
  • gmsh_4_14_0
  • gmsh_4_13_1
  • gmsh_4_13_0
  • gmsh_4_12_2
  • gmsh_4_12_1
  • gmsh_4_12_0
  • gmsh_4_11_1
  • gmsh_4_11_0
  • gmsh_4_10_5
  • gmsh_4_10_4
  • gmsh_4_10_3
  • gmsh_4_10_2
  • gmsh_4_10_1
  • gmsh_4_10_0
  • gmsh_4_9_5
  • gmsh_4_9_4
  • gmsh_4_9_3
  • gmsh_4_9_2
  • gmsh_4_9_1
  • gmsh_4_9_0
41 results

discreteFace.cpp

Blame
  • OS.cpp 12.62 KiB
    // Gmsh - Copyright (C) 1997-2013 C. Geuzaine, J.-F. Remacle
    //
    // See the LICENSE.txt file for license information. Please report all
    // bugs and problems to the public mailing list <gmsh@geuz.org>.
    
    // This file contains a bunch of functions that depend on OS-dependent
    // features and/or system calls
    
    // these are available on all OSes
    #include <stdlib.h>
    #include <stdio.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <signal.h>
    #include <time.h>
    #include <math.h>
    #include "GmshConfig.h"
    #include "StringUtils.h"
    
    #if !defined(WIN32) || defined(__CYGWIN__)
    #include <unistd.h>
    #include <sys/time.h>
    #include <sys/resource.h>
    #endif
    
    #if defined(WIN32)
    #include <windows.h>
    #include <process.h>
    #include <psapi.h>
    #include <io.h>
    #include <direct.h>
    #include <fcntl.h>
    #include <iostream>
    #include <fstream>
    #endif
    
    #if defined(__APPLE__)
    #define RUSAGE_SELF      0
    #define RUSAGE_CHILDREN -1
    #endif
    
    #include "GmshMessage.h"
    
    #if defined(WIN32) && !defined(__CYGWIN__)
    
    // Unicode utility routines borrowed from FLTK
    
    static unsigned utf8decode(const char* p, const char* end, int* len)
    {
      static unsigned short cp1252[32] = {
        0x20ac, 0x0081, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021,
        0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, 0x008d, 0x017d, 0x008f,
        0x0090, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014,
        0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, 0x009d, 0x017e, 0x0178
      };
      unsigned char c = *(unsigned char*)p;
      if (c < 0x80) {
        if (len) *len = 1;
        return c;
      } else if (c < 0xa0) {
        if (len) *len = 1;
        return cp1252[c-0x80];
      } else if (c < 0xc2) {
        goto FAIL;
      }
      if ( (end && p+1 >= end) || (p[1]&0xc0) != 0x80) goto FAIL;
      if (c < 0xe0) {
        if (len) *len = 2;
        return
          ((p[0] & 0x1f) << 6) +