sapling/cstore/py-cstore.cpp
Adam Simpkins ecb0fd2dd7 clib: update C/C++ copyright statements to pass lint checks
Summary:
Update the copyright headers in most of the C/C++ code consistently use the
GPLv2 copyright message.  This allows these files to pass Facebook's internal
C/C++ linters.

Some of the files in fbcode/scm/hgext/cstore/ appear to have actually been
copied from the hg-crew repository, and were not originally authored by
Facebook.  I have not modified the copyright statements in these files:

- cstore/bitmanipulation.h
- cstore/compat.h
- cstore/mpatch.h
- cstore/mpatch.c

I also have not modified any of the cfastmanifest code.

This corresponds to Facebook diff D5588677.

Test Plan:
Confirmed that Facebook's C++ linters no longer complain about the copyright
messages.

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D507
2017-08-25 16:46:07 -07:00

64 lines
1.7 KiB
C++

// Copyright (c) 2004-present, Facebook, Inc.
// All Rights Reserved.
//
// This software may be used and distributed according to the terms of the
// GNU General Public License version 2 or any later version.
// py-cstore.cpp - C++ implementation of a store
// no-check-code
// The PY_SSIZE_T_CLEAN define must be defined before the Python.h include,
// as per the documentation.
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "cstore/py-cdatapack.h"
#include "cstore/py-datapackstore.h"
#include "cstore/py-treemanifest.h"
static PyMethodDef mod_methods[] = {
{NULL, NULL}
};
static char mod_description[] =
"Module containing a native store implementation";
PyMODINIT_FUNC initcstore(void) {
PyObject *mod;
mod = Py_InitModule3("cstore", mod_methods, mod_description);
// Init cdatapack
cdatapack_type.tp_new = PyType_GenericNew;
if (PyType_Ready(&cdatapack_type) < 0) {
return;
}
Py_INCREF(&cdatapack_type);
PyModule_AddObject(mod, "datapack", (PyObject *)&cdatapack_type);
// Init treemanifest
treemanifestType.tp_new = PyType_GenericNew;
if (PyType_Ready(&treemanifestType) < 0) {
return;
}
Py_INCREF(&treemanifestType);
PyModule_AddObject(mod, "treemanifest", (PyObject *)&treemanifestType);
// Init datapackstore
datapackstoreType.tp_new = PyType_GenericNew;
if (PyType_Ready(&datapackstoreType) < 0) {
return;
}
Py_INCREF(&datapackstoreType);
PyModule_AddObject(mod, "datapackstore", (PyObject *)&datapackstoreType);
// Init datapackstore
uniondatapackstoreType.tp_new = PyType_GenericNew;
if (PyType_Ready(&uniondatapackstoreType) < 0) {
return;
}
Py_INCREF(&uniondatapackstoreType);
PyModule_AddObject(mod, "uniondatapackstore", (PyObject *)&uniondatapackstoreType);
}